public virtual void Restore(HttpContext context) { YZRequest request = new YZRequest(context); int taskid = request.GetInt32("TaskID"); string comments = request.GetString("Comments", null); using (BPMConnection cn = new BPMConnection()) { cn.WebOpen(); BPMTask.Continue(cn, taskid, comments); } }
public virtual JObject RestoreExt(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.Continue(cn, taskid); 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); } }