public string Save() { string str1 = this.Request["html"]; string str2 = this.Request["name"]; string str3 = this.Request["att"]; string str4 = this.Request["id"]; string str5 = this.Request["type"]; string str6 = this.Request["subtable"]; string str7 = this.Request["formEvents"]; if (str2.IsNullOrEmpty()) { return("表单名称不能为空!"); } Guid test; if (!str4.IsGuid(out test)) { return("表单ID无效!"); } RoadFlow.Platform.WorkFlowForm workFlowForm = new RoadFlow.Platform.WorkFlowForm(); RoadFlow.Data.Model.WorkFlowForm model = workFlowForm.Get(test); bool flag = false; string oldXML = string.Empty; if (model == null) { model = new RoadFlow.Data.Model.WorkFlowForm(); model.ID = test; model.CreateUserID = RoadFlow.Platform.Users.CurrentUserID; model.CreateUserName = RoadFlow.Platform.Users.CurrentUserName; model.CreateTime = DateTimeNew.Now; model.Status = 0; flag = true; } else { oldXML = model.Serialize(); } model.Attribute = str3; model.Html = str1; model.LastModifyTime = DateTimeNew.Now; model.Name = str2; model.Type = str5.ToGuid(); model.SubTableJson = str6; model.EventsJson = str7; if (flag) { workFlowForm.Add(model); RoadFlow.Platform.Log.Add("添加了流程表单", model.Serialize(), RoadFlow.Platform.Log.Types.流程相关, "", "", (RoadFlow.Data.Model.Users)null); } else { workFlowForm.Update(model); RoadFlow.Platform.Log.Add("修改了流程表单", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, model.Serialize(), (RoadFlow.Data.Model.Users)null); } return("保存成功!"); }
public string Save() { string html = Request["html"]; string name = Request["name"]; string att = Request["att"]; string id = Request["id"]; string type = Request["type"]; string subtable = Request["subtable"]; string formEvents = Request["formEvents"]; if (name.IsNullOrEmpty()) { return("表单名称不能为空!"); } Guid formID; if (!id.IsGuid(out formID)) { return("表单ID无效!"); } RoadFlow.Platform.WorkFlowForm WFF = new RoadFlow.Platform.WorkFlowForm(); RoadFlow.Data.Model.WorkFlowForm wff = WFF.Get(formID); bool isAdd = false; string oldXML = string.Empty; if (wff == null) { wff = new RoadFlow.Data.Model.WorkFlowForm(); wff.ID = formID; wff.Type = type.Convert <Guid>(); wff.CreateUserID = RoadFlow.Platform.UsersBLL.CurrentUserID; wff.CreateUserName = RoadFlow.Platform.UsersBLL.CurrentUserName; wff.CreateTime = DateTime.Now; wff.Status = 0; isAdd = true; } else { oldXML = wff.Serialize(); } wff.Attribute = att; wff.Html = html; wff.LastModifyTime = DateTime.Now; wff.Name = name; wff.SubTableJson = subtable; wff.EventsJson = formEvents; if (isAdd) { WFF.Add(wff); RoadFlow.Platform.Log.Add("添加了流程表单", wff.Serialize(), RoadFlow.Platform.Log.Types.流程相关); } else { WFF.Update(wff); RoadFlow.Platform.Log.Add("修改了流程表单", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, wff.Serialize()); } return("保存成功!"); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string html = context.Request["html"]; string name = context.Request["name"]; string att = context.Request["att"]; string id = context.Request["id"]; string type = context.Request["type"]; string subtable = context.Request["subtable"]; string formEvents = context.Request["formEvents"]; if (name.IsNullOrEmpty()) { context.Response.Write("表单名称不能为空!"); return; } Guid formID; if (!id.IsGuid(out formID)) { context.Response.Write("表单ID无效!"); return; } RoadFlow.Platform.WorkFlowForm WFF = new RoadFlow.Platform.WorkFlowForm(); RoadFlow.Data.Model.WorkFlowForm wff = WFF.Get(formID); bool isAdd = false; string oldXML = string.Empty; if (wff == null) { wff = new RoadFlow.Data.Model.WorkFlowForm(); wff.ID = formID; wff.CreateUserID = RoadFlow.Platform.Users.CurrentUserID; wff.CreateUserName = RoadFlow.Platform.Users.CurrentUserName; wff.CreateTime = RoadFlow.Utility.DateTimeNew.Now; wff.Status = 0; isAdd = true; } else { oldXML = wff.Serialize(); } wff.Type = type.ToGuid(); wff.Attribute = att; wff.Html = html; wff.LastModifyTime = RoadFlow.Utility.DateTimeNew.Now; wff.Name = name; wff.SubTableJson = subtable; wff.EventsJson = formEvents; if (isAdd) { WFF.Add(wff); RoadFlow.Platform.Log.Add("添加了流程表单", wff.Serialize(), RoadFlow.Platform.Log.Types.流程相关); } else { WFF.Update(wff); RoadFlow.Platform.Log.Add("修改了流程表单", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, wff.Serialize()); } context.Response.Write("保存成功!"); }