public ResultModel StartProcess(string processCode, string processName, int loginId, string realName, string ObjectId, string Folio, Dictionary <string, string> dataFields) { int procInstID = 0; var jr = K2ServiceProvider.StartProcess(processName, loginId, ObjectId, Folio, dataFields, out procInstID); if (jr.Code == ResultCode.Sucess) { if (procInstID > 0) { var comment = new K2CommentPO(); comment.ActivityName = "发起人"; comment.ProcessCode = processCode; comment.AddDate = DateTime.Now; comment.ProcInstID = procInstID; comment.Action = "提交"; comment.Memo = "发起流程"; comment.RealName = realName; comment.LoginID = loginId; try { K2CommentRepostories.Save(comment); } catch { } } } return(jr); }
public ResultModel ReAssign(string sn, int assignFromLoginId, string assignFromRealName, int assignToLoginId, string assignToRealName, bool isAddLog) { string activityName = string.Empty; string processCode = string.Empty; int procInstID = 0; var jr = K2ServiceProvider.ReAssign(sn, assignFromLoginId, assignToLoginId, out activityName, out processCode, out procInstID); if (jr.Code == ResultCode.Sucess) { if (isAddLog) { if (procInstID > 0) { var comment = new K2CommentPO(); comment.ActivityName = activityName; comment.ProcInstID = procInstID; comment.ProcessCode = processCode; comment.Action = "转签"; comment.LoginID = assignFromLoginId; comment.RealName = assignFromRealName; comment.ActionTo = assignToRealName; comment.AddDate = DateTime.Now; comment.Memo = string.Format("{0}转签给{1}", assignFromRealName, assignToRealName); try { K2CommentRepostories.Save(comment); } catch { } } } } return(jr); }
/// <summary> /// 保存k2审批意见 /// </summary> /// <param name="k2Comment"> /// k2审批意见持久化对象 /// <see cref="DianPing.WorkFlow.Repositories.Interface.DianPingK2Sln.Entity.K2CommentPO"/> /// </param> public int Save(K2CommentPO k2Comment) { var edm = new DianPingK2SlnContext(); edm.K2Comment.Add(k2Comment); return(edm.SaveChanges()); }
public ResultModel ApproveK2Process(string processCode, string sn, int loginId, string realName, string actionString, string memo, Dictionary <string, string> dataFields) { string activityName = string.Empty; int procInstID = 0; var jr = K2ServiceProvider.ApproveK2Process(sn, loginId, actionString, memo, dataFields, out activityName, out processCode, out procInstID); if (jr.Code == ResultCode.Sucess) { if (procInstID > 0) { var comment = new K2CommentPO(); comment.ActivityName = activityName; comment.ProcInstID = procInstID; comment.ProcessCode = processCode; comment.Action = actionString; comment.LoginID = loginId; comment.RealName = realName; comment.AddDate = DateTime.Now; comment.Memo = string.IsNullOrEmpty(memo) ? string.Empty : memo; try { K2CommentRepostories.Save(comment); } catch { } } } return(jr); }
/// <summary> /// 保存k2审批意见 /// </summary> /// <param name="k2Comment"> /// k2审批意见持久化对象 /// <see cref="DianPing.WorkFlow.Repositories.Interface.DianPingK2Sln.Entity.K2CommentPO"/> /// </param> public void Save(K2CommentPO k2Comment) { k2CommentRepostories.Save(k2Comment); }