public string Save(Model.FlowButton flowButtonModel) { if (!ModelState.IsValid) { return(Tools.GetValidateErrorMessag(ModelState)); } Business.FlowButton flowButton = new Business.FlowButton(); if (Request.Querys("buttonid").IsGuid(out Guid guid)) { var oldModel = flowButton.Get(guid); string oldJSON = null == oldModel ? "" : oldModel.ToString(); flowButton.Update(flowButtonModel); Business.Log.Add("修改了流程按钮-" + flowButtonModel.Title, type: Business.Log.Type.流程管理, oldContents: oldJSON, newContents: flowButtonModel.ToString()); } else { flowButton.Add(flowButtonModel); Business.Log.Add("添加了流程按钮-" + flowButtonModel.Title, flowButtonModel.ToString(), Business.Log.Type.流程管理); } return("保存成功!"); }
public IActionResult Edit() { string buttonId = Request.Querys("buttonid"); Business.FlowButton flowButton = new Business.FlowButton(); Model.FlowButton flowButtonModel = null; if (buttonId.IsGuid(out Guid bid)) { flowButtonModel = flowButton.Get(bid); } if (null == flowButtonModel) { flowButtonModel = new Model.FlowButton { Id = Guid.NewGuid(), Sort = flowButton.GetMaxSort() }; } ViewData["queryString"] = Request.UrlQuery(); return(View(flowButtonModel)); }