public virtual JObject ReturnToInitiator(HttpContext context) { YZRequest request = new YZRequest(context); this.ApproveCheck(context); int taskid = request.GetInt32("TaskID"); JObject jPost = request.GetPostData <JObject>(); string comments = (string)jPost["comments"]; string formdata = (string)jPost["formdata"]; using (BPMConnection cn = new BPMConnection()) { cn.WebOpen(); //移动审批不保存表单数据 if (!String.IsNullOrEmpty(formdata)) { BPMProcess.Post(cn, formdata); } User user = BPMTask.RecedeRestart(cn, taskid, comments); JObject rv = new JObject(); rv[YZJsonProperty.success] = true; rv["UserFriendlyName"] = user.FriendlyName; return(rv); } }
public virtual JObject ReturnToInitiatorExt(HttpContext context) { JArray processedItems = new JArray(); try { YZRequest request = new YZRequest(context); JObject jPost = request.GetPostData <JObject>(); string comments = (string)jPost["comments"]; JArray items = (JArray)jPost["items"]; using (BPMConnection cn = new BPMConnection()) { cn.WebOpen(); foreach (JObject item in items) { int id = (int)item["ID"]; int taskid = (int)item["TaskID"]; BPMTask.RecedeRestart(cn, taskid, comments); JObject processedItem = new JObject(); processedItem["ID"] = id; processedItems.Add(processedItem); } JObject rv = new JObject(); rv[YZJsonProperty.success] = true; rv[YZJsonProperty.processedItems] = processedItems; return(rv); } } catch (Exception exp) { JObject rv = new JObject(); rv[YZJsonProperty.success] = false; rv[YZJsonProperty.errorMessage] = exp.Message; rv[YZJsonProperty.processedItems] = processedItems; return(rv); } }
public virtual object ReturnToInitiator(HttpContext context) { YZRequest request = new YZRequest(context); int taskid = request.GetInt32("TaskID"); JObject jPost = request.GetPostData <JObject>(); string comments = (string)jPost["comments"]; string formdata = (string)jPost["formdata"]; using (BPMConnection cn = new BPMConnection()) { cn.WebOpen(); if (!String.IsNullOrEmpty(formdata)) { BPMProcess.Post(cn, formdata); } User user = BPMTask.RecedeRestart(cn, taskid, comments); return(new{ UserFriendlyName = user.FriendlyName }); } }