审批时进行判断

      it["审批意见"] = li["审批意见"];

                if (li["审批意见"] == null)
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), string.Format("<script>alert('请填写审批意见,点编辑!')</script>"));
                  
                }
                else
                {
                    it["审批人"] = SPContext.Current.Web.CurrentUser.Name;
                    it["审批时间"] = DateTime.Now.ToString("yyyy-MM-dd");
                  
                  
                   

                    it.Update();
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), string.Format("<script>alert('成功!')</script>"));
               
                }

原文地址:https://www.cnblogs.com/914556495wxkj/p/3584687.html