public JsonResult GetWorkFlowDef() { string id = QueryString("id"); id.CheckNotNullOrEmpty("id"); WFDef cForm = UnitOfWork.GetByKey <WFDef>(id); cForm.CheckNotNull("WFDef"); return(Json(cForm)); }
public JsonResult Publish() { string bPublish = QueryString("bPublish"); bPublish.CheckBoolType("bPublish"); string id = QueryString("id"); id.CheckNotNullOrEmpty("id"); WFDef wfDef = UnitOfWork.GetByKey <WFDef>(id); wfDef.CheckNotNull("WFDef"); wfDef.IsPublish = bPublish; if (wfDef.IsPublish == "true") { var defInst = wfDef.CreateInst(); UnitOfWork.Add <WFDefInst>(defInst); } return(Json(UnitOfWork.Commit())); }
public JsonResult AddWorkFlow() { var dataStr = QueryString("data"); WFDef wfd = dataStr.JsonToObject <WFDef>(); wfd.Id = GuidHelper.CreateTimeOrderID(); wfd.IsPublish = "false"; wfd.Code = wfd.EntityFullName.Replace(".", "_");//xx_xxx_xx UnitOfWork.Add(wfd); WFDefInst defInst = new WFDefInst(); ConvertHelper.UpdateEntity(defInst, dataStr.JsonToDictionary()); defInst.Id = GuidHelper.CreateTimeOrderID(); defInst.WFDefId = wfd.Id; UnitOfWork.Add(defInst); bool b = UnitOfWork.Commit(); return(Json(b)); }
public JsonResult SaveWorkFlowDef() { var dic = Request.Form["formData"].JsonToObject <Dictionary <string, object> >(); string id = dic.GetValue("Id"); #region Def if (string.IsNullOrEmpty(id)) { WFDef flowDef = ConvertHelper.ConvertToObj <WFDef>(dic); flowDef.Id = GuidHelper.CreateTimeOrderID(); UnitOfWork.Add(flowDef); } else { WFDef flowDef = UnitOfWork.GetByKey <WFDef>(id); ConvertHelper.UpdateEntity(flowDef, dic); UnitOfWork.UpdateEntity(flowDef); } #endregion bool b = UnitOfWork.Commit(); return(Json(b)); }