/// <summary> /// 发消息给用户 /// </summary> /// <param name="msg">消息类型(已通过|被拒绝)</param> private void SendMessage(string msg) { EtNet_Models.Information messageEntity = new EtNet_Models.Information(); DataTable tbl = To_PolicyManager.GetLists(" isVerify=" + Request.QueryString["jobflowid"].ToString()); messageEntity.associationid = 0;//此处不需要,默认给一个值 messageEntity.contents = string.Format("编号为{0}的保单,{1}", tbl.Rows[0]["serialnum"], msg); messageEntity.createtime = DateTime.Now; messageEntity.founderid = (Session["login"] as LoginInfo).Id; messageEntity.sendtime = DateTime.Now; messageEntity.sortid = 1;//消息分类:个人消息 if (InformationManager.Add(messageEntity)) { int userID = int.Parse(tbl.Rows[0]["policy_makerId"].ToString()); int messageID = InformationManager.GetMaxId(); EtNet_Models.InformationNotice messageNoticeEntity = new InformationNotice(); messageNoticeEntity.informationid = messageID; messageNoticeEntity.recipientid = userID; messageNoticeEntity.remind = "是";//默认未阅读; InformationNoticeManager.Add(messageNoticeEntity); } }
/// <summary> /// 发消息给用户 /// </summary> private void SendMessage() { string userStr = hidUserList.Value.Trim().TrimEnd(','); if (userStr != string.Empty) { EtNet_Models.Information messageEntity = new EtNet_Models.Information(); messageEntity.associationid = 0;//此处不需要,默认给一个值 messageEntity.contents = string.Format("{0}收到一张水单,金额为{1},请相关业务员尽快来认领。", txtMarkDate.Text, txtMoney.Text); messageEntity.createtime = DateTime.Now; messageEntity.founderid = (Session["login"] as LoginInfo).Id; messageEntity.sendtime = DateTime.Now; messageEntity.sortid = 1;//消息分类:个人消息 if (InformationManager.Add(messageEntity)) { IEnumerable <string> userList = userStr.Split(',').Where(x => x != string.Empty); int messageID = InformationManager.GetMaxId(); EtNet_Models.InformationNotice messageNoticeEntity = new InformationNotice(); messageNoticeEntity.informationid = messageID; foreach (string user in userList) { messageNoticeEntity.recipientid = int.Parse(user); messageNoticeEntity.remind = "是";//默认未阅读; InformationNoticeManager.Add(messageNoticeEntity); } } } }
/// <summary> /// 发消息给审核用户 /// </summary> /// <param name="ruleID">审核规则ID</param> /// <param name="num">业务编号</param> private void SendMessage(int ruleID, string num) { ApprovalRule rule = ApprovalRuleManager.GetModel(ruleID); if (rule.idgourp.Trim() != string.Empty) { EtNet_Models.Information messageEntity = new EtNet_Models.Information(); messageEntity.associationid = 0;//此处不需要,默认给一个值 messageEntity.contents = string.Format("编号为{0}的保单需要您审批!", num); messageEntity.createtime = DateTime.Now; messageEntity.founderid = (Session["login"] as LoginInfo).Id; messageEntity.sendtime = DateTime.Now; messageEntity.sortid = 10;//消息分类:保单审核 if (messageBLL.Add(messageEntity)) { IEnumerable <string> userList = rule.idgourp.Split(',').Where(x => x != string.Empty); int messageID = messageBLL.GetMaxId(); EtNet_Models.InformationNotice messageNoticeEntity = new InformationNotice(); messageNoticeEntity.informationid = messageID; foreach (string user in userList) { messageNoticeEntity.recipientid = int.Parse(user); messageNoticeEntity.remind = "是";//默认未阅读; InformationNoticeManager.Add(messageNoticeEntity); } } } }
/// <summary> /// 发消息给审核用户 /// </summary> private void SendMessage(string serialNumber) { ApprovalRule rule = ApprovalRuleManager.GetModel(int.Parse(ddlApproval.SelectedValue)); if (rule.idgourp.Trim() != string.Empty) { EtNet_Models.Information messageEntity = new EtNet_Models.Information(); messageEntity.associationid = 0;//此处不需要,默认给一个值 messageEntity.contents = string.Format("编号为{0}的单据需要您审批!", serialNumber); messageEntity.createtime = DateTime.Now; messageEntity.founderid = (Session["login"] as LoginInfo).Id; messageEntity.sendtime = DateTime.Now; messageEntity.sortid = 1;//消息分类:个人消息 if (InformationManager.Add(messageEntity)) { IEnumerable <string> userList = rule.idgourp.Split(',').Where(x => x != string.Empty); int messageID = InformationManager.GetMaxId(); EtNet_Models.InformationNotice messageNoticeEntity = new InformationNotice(); messageNoticeEntity.informationid = messageID; int len = rule.sort == "单审" ? 1 : userList.Count(); if (rule.sort == "单审") { messageNoticeEntity.recipientid = int.Parse(userList.ElementAt(0)); messageNoticeEntity.remind = "是";//默认未阅读; InformationNoticeManager.Add(messageNoticeEntity); } else { foreach (string user in userList) { messageNoticeEntity.recipientid = int.Parse(user); messageNoticeEntity.remind = "是";//默认未阅读; InformationNoticeManager.Add(messageNoticeEntity); } } } } }
/// <summary> /// 发消息给审核用户 /// </summary> private void SendMessage(string serialNum, int ruleid) { ApprovalRule rule = ApprovalRuleManager.GetModel(ruleid); if (rule.idgourp.Trim() != string.Empty) { EtNet_Models.Information messageEntity = new EtNet_Models.Information(); messageEntity.associationid = 0; //此处不需要,默认给一个值 消息分类关联的id值,邮件的id值,文档的id值 messageEntity.contents = string.Format("编号为{0}的定单需要您审批!", serialNum); //消息提示信息 messageEntity.createtime = DateTime.Now; //创建时间 messageEntity.founderid = (Session["login"] as LoginInfo).Id; //创建人id messageEntity.sendtime = DateTime.Now; //发送时间 messageEntity.sortid = 10; //消息分类:保单审核 if (messageBLL.Add(messageEntity)) { IEnumerable <string> userList = rule.idgourp.Split(',').Where(x => x != string.Empty); int messageID = messageBLL.GetMaxId(); EtNet_Models.InformationNotice messageNoticeEntity = new InformationNotice(); messageNoticeEntity.informationid = messageID; int len = rule.sort == "单审" ? 1 : userList.Count(); if (rule.sort == "单审") { messageNoticeEntity.recipientid = int.Parse(userList.ElementAt(0)); messageNoticeEntity.remind = "是";//默认未阅读; InformationNoticeManager.Add(messageNoticeEntity); } else { foreach (string user in userList) { messageNoticeEntity.recipientid = int.Parse(user); messageNoticeEntity.remind = "是";//默认未阅读; InformationNoticeManager.Add(messageNoticeEntity); } } } } }
/// <summary> /// 发消息给用户 /// </summary> /// <param name="falg">0:取消确认,1:取消认领</param> private void SendMessage(int collectingID, int falg) { To_Collecting collecting = To_CollectingManager.getTo_CollectingById(collectingID); if (collecting == null) { return; } EtNet_Models.Information messageEntity = new EtNet_Models.Information(); To_ClaimManager claimBLL = new To_ClaimManager(); string salesman = claimBLL.GetFiledValue(collectingID, "salesman"); string msg = ""; if (falg == 0) { msg = string.Format("收款编号:{0},被业务员:{1},取消认领,取消时间:{2}", collecting.ReceiptNum, salesman, DateTime.Now.ToShortDateString()); } else { msg = string.Format("业务员:{0},对收款编号:{1},进行收款认定修改!", salesman, collecting.ReceiptNum); } messageEntity.associationid = 0;//此处不需要,默认给一个值 messageEntity.contents = msg; messageEntity.createtime = DateTime.Now; messageEntity.founderid = (Session["login"] as LoginInfo).Id; messageEntity.sendtime = DateTime.Now; messageEntity.sortid = 1;//消息分类:个人消息 if (InformationManager.Add(messageEntity)) { int messageID = InformationManager.GetMaxId(); EtNet_Models.InformationNotice messageNoticeEntity = new InformationNotice(); messageNoticeEntity.informationid = messageID; messageNoticeEntity.recipientid = collecting.MarkerID; messageNoticeEntity.remind = "是";//默认未阅读; InformationNoticeManager.Add(messageNoticeEntity); } }