public static void AddSync(string mobileNumber, string contents, int status, Guid sendUserID, string sendUserName = "", string note = "") { SMSLog.AddSync(new RoadFlow.Data.Model.SMSLog() { Contents = contents, ID = Guid.NewGuid(), MobileNumber = mobileNumber, SendTime = DateTimeNew.Now, SendUserID = new Guid?(sendUserID.IsEmptyGuid() ? Users.CurrentUserID : sendUserID), SendUserName = sendUserName.IsNullOrEmpty() ? Users.CurrentUserName : sendUserName, Status = status, Note = note }); }
public static string SendSMS(string mobileNumber, string contents) { if (mobileNumber.IsNullOrEmpty() || contents.IsNullOrEmpty()) { return(""); } string str = mobileNumber; char[] chArray = new char[1] { ',' }; foreach (string mobileNumber1 in str.Split(chArray)) { SMSLog.AddSync(mobileNumber1, contents, 1, Guid.Empty, "", ""); } return(""); }
public static void Hasten(string types, string users, string contents, RoadFlow.Data.Model.WorkFlowTask task, string othersParams = "") { if (!users.IsNullOrEmpty() && !types.IsNullOrEmpty() && task != null) { string[] array = users.Split(','); Guid guid = Guid.NewGuid(); List <RoadFlow.Data.Model.WorkFlowTask> list = new WorkFlowTask().GetNextTaskList(task.ID).FindAll((RoadFlow.Data.Model.WorkFlowTask p) => p.Status.In(0, 1)); string text = ""; text = ((!(HttpContext.Current.Request.Url != null) || !HttpContext.Current.Request.Url.AbsolutePath.EndsWith(".aspx", StringComparison.CurrentCultureIgnoreCase)) ? "/WorkFlowRun/Index" : "/Platform/WorkFlowRun/Default.aspx"); string[] array2 = types.Split(','); for (int i = 0; i < array2.Length; i++) { int test; if (array2[i].IsInt(out test)) { string[] array3 = array; foreach (string id in array3) { Guid userGuid; if (Users.RemovePrefix(id).IsGuid(out userGuid)) { RoadFlow.Data.Model.WorkFlowTask workFlowTask = list.Find((RoadFlow.Data.Model.WorkFlowTask p) => p.ReceiveID == userGuid); string linkUrl = (workFlowTask == null) ? "" : ("javascript:openApp('" + text + "?flowid=" + workFlowTask.FlowID + "&stepid=" + workFlowTask.StepID + "&instanceid=" + workFlowTask.InstanceID + "&taskid=" + workFlowTask.ID + "&groupid=" + workFlowTask.GroupID + "',0,'" + workFlowTask.Title.Replace1(",", "") + "','tab_" + workFlowTask.ID + "');closeMessage('" + guid + "');"); switch (test) { case 1: SMSLog.SendSMS(new Users().GetMobileNumber(userGuid), contents); break; case 2: Email.Send(userGuid, "任务催办", contents); break; case 3: { RoadFlow.Data.Model.Users users3 = new Users().Get(userGuid); if (users3 != null) { ShortMessage.Send(users3.ID, users3.Name, "任务催办", contents, 0, linkUrl, task.ID.ToString(), guid.ToString()); } break; } case 4: { RoadFlow.Data.Model.Users users2 = new Users().Get(userGuid); if (users2 != null) { new Message().SendText(contents, users2.Account, "", "", 0, new Agents().GetAgentIDByCode("weixinagents_waittasks"), true); } break; } } } } } } RoadFlow.Data.Model.HastenLog hastenLog = new RoadFlow.Data.Model.HastenLog(); hastenLog.Contents = contents; hastenLog.ID = Guid.NewGuid(); hastenLog.SendTime = DateTimeNew.Now; hastenLog.SendUser = Users.CurrentUserID; hastenLog.SendUserName = Users.CurrentUserName; hastenLog.OthersParams = (othersParams.IsNullOrEmpty() ? task.ID.ToString() : othersParams); hastenLog.Types = types; hastenLog.Users = users; new HastenLog().Add(hastenLog); } }
public static void Hasten(string types, string users, string contents, RoadFlow.Data.Model.WorkFlowTask task, string othersParams = "") { if (users.IsNullOrEmpty() || types.IsNullOrEmpty() || task == null) { return; } string[] strArray = users.Split(','); Guid guid = Guid.NewGuid(); List <RoadFlow.Data.Model.WorkFlowTask> all = new WorkFlowTask().GetNextTaskList(task.ID).FindAll((Predicate <RoadFlow.Data.Model.WorkFlowTask>)(p => p.Status.In(0, 1))); string str1 = !(HttpContext.Current.Request.Url != (Uri)null) || !HttpContext.Current.Request.Url.AbsolutePath.EndsWith(".aspx", StringComparison.CurrentCultureIgnoreCase) ? "/WorkFlowRun/Index" : "/Platform/WorkFlowRun/Default.aspx"; string str2 = types; char[] chArray = new char[1] { ',' }; foreach (string str3 in str2.Split(chArray)) { int test; if (str3.IsInt(out test)) { foreach (string id in strArray) { Guid userGuid; if (Users.RemovePrefix(id).IsGuid(out userGuid)) { RoadFlow.Data.Model.WorkFlowTask workFlowTask = all.Find((Predicate <RoadFlow.Data.Model.WorkFlowTask>)(p => p.ReceiveID == userGuid)); string str4; if (workFlowTask != null) { str4 = "javascript:openApp('" + str1 + "?flowid=" + (object)workFlowTask.FlowID + "&stepid=" + (object)workFlowTask.StepID + "&instanceid=" + workFlowTask.InstanceID + "&taskid=" + (object)workFlowTask.ID + "&groupid=" + (object)workFlowTask.GroupID + "',0,'" + workFlowTask.Title.Replace1(",", "") + "','tab_" + (object)workFlowTask.ID + "');closeMessage('" + (object)guid + "');"; } else { str4 = ""; } string linkUrl = str4; switch (test) { case 1: SMSLog.SendSMS(new Users().GetMobileNumber(userGuid), contents); continue; case 2: Email.Send(userGuid, "任务催办", contents, ""); continue; case 3: RoadFlow.Data.Model.Users users1 = new Users().Get(userGuid); if (users1 != null) { ShortMessage.Send(users1.ID, users1.Name, "任务催办", contents, 0, linkUrl, task.ID.ToString(), guid.ToString()); continue; } continue; case 4: RoadFlow.Data.Model.Users users2 = new Users().Get(userGuid); if (users2 != null) { new Message().SendText(contents, users2.Account, "", "", 0, new Agents().GetAgentIDByCode("weixinagents_waittasks"), true); continue; } continue; default: continue; } } } } } new HastenLog().Add(new RoadFlow.Data.Model.HastenLog() { Contents = contents, ID = Guid.NewGuid(), SendTime = DateTimeNew.Now, SendUser = Users.CurrentUserID, SendUserName = Users.CurrentUserName, OthersParams = othersParams.IsNullOrEmpty() ? task.ID.ToString() : othersParams, Types = types, Users = users }); }