public static void SendSms(object sender, ApproveEventArgs args) { ISMS sms = ctx["SMS"] as ISMS; IWorker worker = ctx["Worker"] as IWorker; //string title = string.Format("{0}(表单号:{1})被否决", args.FlowName, args.FlowNo); string content = string.Format("您于{0}申请的{1}(表单号:{2})已经被否决。", args.BeginDate.ToString("yyyy/MM/dd HH:mm"), args.FlowName, args.FlowNo); B_WORKER w = worker.GetWorkerById(args.ApplyerId); if (w != null && !string.IsNullOrEmpty(w.Mobile)) { sms.SendSMG(new List <string> { w.Mobile }, content, "99999"); //if (!innerCommBLL.SendSMG(new List<string> { w.Mobile }, content, "99999")) //{ // throw new Exception(string.Format("短信发送失败,flowId{0},flowNo{1},AppValue{2}", args.FlowId, args.FlowNo, args.AppValue)); //} } }
/// <summary> /// 否决 /// </summary> public void Reject() { F_INST_FLOW inst = DAL.WorkFlow.FlowInstance.Get(m_FlowInstanceId); inst.EndDate = DateTime.Now; inst.State = FlowInstanceState.Reject; DAL.WorkFlow.FlowInstance.Save(inst); //更新其他对象 ApproveEventArgs e = new ApproveEventArgs(); e.FlowId = this.FlowDefine.ID; e.FlowName = this.FlowDefine.Name; e.FlowInstId = this.ID; e.AppValue = WorkItemAppValue.Reject; e.Url = this.FlowDefine.Url; e.BeginDate = this.m_BeginDate; e.IsInner = this.FlowDefine.IsInner; e.FlowNo = this.FlowNo; e.ApplyerId = this.m_ApplerId; ApproveReject(this, e);//调用相关方法 }
private void HandleApproveEvent_Invoked(object sender, ExternalDataEventArgs e) { ApproveEventArgs statusArgs = e as ApproveEventArgs; ObjectId = statusArgs.ObjectId; Upn = statusArgs.Identity; Comment = statusArgs.Comment; _pass = true; }
public void Approve(Guid workflowId, Guid objectId, string upn, string comment) { ApproveEventArgs args = new ApproveEventArgs(workflowId, objectId, upn, comment); args.Identity = upn; EventHandler <ApproveEventArgs> eventHandler = Approved; if (eventHandler != null) { eventHandler(null, args); } }
public static void SendMail(object sender, ApproveEventArgs args) { IEmail email = ctx["Email"] as IEmail; IFlow flow = ctx["Flow"] as IFlow; string title; StringBuilder content = new StringBuilder(); string link = string.Format(@"<a href='#' style='cursor:hand' onclick=Open('/WorkFlow/TraceView/?flowNo={0}&flowId={1}&flowInstId={2}&url={3}&isInner={4}')><u>表单号:{5}</u></a>", args.FlowNo, args.FlowId, args.FlowInstId, args.Url, args.IsInner, args.FlowNo); if (args.AppValue == "Y") { title = string.Format("{0}(表单号:{1})已经审核通过", args.FlowName, args.FlowNo); content.Append("<html><meta http-equiv='content-type' content='text/html; charset=gb2312' /><body>"); content.AppendFormat("您于{0}申请的{1}({2})已经审核通过。", args.BeginDate.ToString("yyyy/MM/dd HH:mm"), args.FlowName, link); } else { title = string.Format("{0}(表单号:{1})被否决", args.FlowName, args.FlowNo); content.AppendFormat("您于{0}申请的{1}({2})已经被否决。", args.BeginDate.ToString("yyyy/MM/dd HH:mm"), args.FlowName, link); } //content.Append("<BR><table cellspace='1' style='width:350px;' id='tablehelp'>"); //content.Append("<tr><td><b>签核记录:</b></td><td>"); content.AppendLine("<br>"); content.AppendLine(flow.TaskListScript(args.FlowInstId)); //content.Append("</td></tr></table></body><html>"); email.SendMail(title, content.ToString(), args.ApplyerId.ToString(), false); //if (!email.SendMail(title, content.ToString(), args.ApplyerId.ToString(), false)) //{ // throw new Exception(string.Format("邮件发送失败:flowId{0},flowNo{1},AppValue{2}", args.FlowId, args.FlowNo, args.AppValue)); //} }
public static void Update(object sender, ApproveEventArgs args) { FlowAction <IComplete> flowAction = new FlowAction <IComplete>(args.IsInner, args.FlowId); if (flowAction.action != null) { if (!flowAction.action.Complete(args.FlowNo, args.AppValue)) { throw new Exception(string.Format("回写失败,flowId{0},flowNo{1},AppValue{2}", args.FlowId, args.FlowNo, args.AppValue)); } } //else //{ // throw new Exception(string.Format("没有配置回写,flowId{0},flowNo{1},AppValue{2}", args.FlowId, args.FlowNo, args.AppValue)); //} }
private void imageApprove_MouseUp(object sender, MouseButtonEventArgs e) { image_MouseUp(sender, e); var args = new ApproveEventArgs(); if (OnApprove != null) { OnApprove(this, args); } if (args.IsValid && Calculator.Current.State == TargetState) { Calculator.Current.Next(); } }