Пример #1
0
        /// <summary>
        /// 发送消息
        /// </summary>
        private void SendInformation(int jobflowid, int ruleid)
        {
            EtNet_Models.ApprovalRule rule      = EtNet_BLL.ApprovalRuleManager.GetModel(ruleid);
            string[]                 list       = rule.idgourp.Split(',');
            EtNet_Models.JobFlow     model      = EtNet_BLL.JobFlowManager.GetModel(jobflowid);
            EtNet_Models.Information informodel = null;
            if (model != null)
            {
                informodel               = new EtNet_Models.Information();
                informodel.sortid        = 9;
                informodel.associationid = jobflowid;
                informodel.contents      = "编号为" + model.cname + "的客户需要您审批!";
                informodel.createtime    = DateTime.Now;
                informodel.sendtime      = DateTime.Now;
                informodel.founderid     = ((EtNet_Models.LoginInfo)Session["login"]).Id;
                if (EtNet_BLL.InformationManager.Add(informodel))
                {
                    int maxid = EtNet_BLL.InformationManager.GetMaxId();
                    EtNet_Models.InformationNotice infnotic = null;

                    int len = (rule.sort == "单审") ? 1 : list.Length;

                    for (int j = 0; j < len; j++)
                    {
                        infnotic = new EtNet_Models.InformationNotice();
                        infnotic.informationid = maxid;
                        infnotic.recipientid   = int.Parse(list[j].ToString());
                        infnotic.remind        = "是";
                        EtNet_BLL.InformationNoticeManager.Add(infnotic);
                    }
                }
            }
        }
Пример #2
0
        /// <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);
            }
        }
Пример #3
0
        /// <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);
                    }
                }
            }
        }
Пример #4
0
        /// <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);
                    }
                }
            }
        }
Пример #5
0
        /// <summary>
        /// 创建消息,返回消息的id值
        /// </summary>
        public int CreateInfo(string straudit)
        {
            EtNet_Models.Information model = new EtNet_Models.Information();
            model.sortid        = 1;
            model.associationid = 1;
            model.createtime    = DateTime.Now;
            model.sendtime      = DateTime.Now;
            model.founderid     = ((EtNet_Models.LoginInfo)Session["login"]).Id;
            model.contents      = straudit;
            EtNet_BLL.InformationManager.Add(model);
            int maxid = EtNet_BLL.InformationManager.GetMaxId(((EtNet_Models.LoginInfo)Session["login"]).Id.ToString());

            return(maxid);
        }
Пример #6
0
        /// <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);
                        }
                    }
                }
            }
        }
Пример #7
0
        /// <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);
                        }
                    }
                }
            }
        }
Пример #8
0
        /// <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);
            }
        }
Пример #9
0
        /// <summary>
        /// 发送审批消息给下一个审批人员
        /// </summary>
        public void SendNextAudit(int jfid)
        {
            EtNet_Models.LoginInfo login   = ((EtNet_Models.LoginInfo)Session["login"]);
            EtNet_Models.JobFlow   jfmodel = EtNet_BLL.JobFlowManager.GetModel(jfid);
            if (jfmodel != null)
            {
                EtNet_Models.ApprovalRule rule = EtNet_BLL.ApprovalRuleManager.GetModel(jfmodel.ruleid);
                string[] list = rule.idgourp.Split(',');
                if (rule.sort != "单审" || list.Length == 1)
                {
                    return;
                }
                if (list[list.Length - 1] == login.Id.ToString())
                {
                    return;
                }

                int recipientid = 0;
                for (int i = 0; i < list.Length; i++)
                {
                    if (list[i] == login.Id.ToString() && i != list.Length - 1)
                    {
                        recipientid = int.Parse(list[i + 1]);
                    }
                }
                EtNet_Models.Information model = new EtNet_Models.Information();
                model.sortid        = 10;
                model.associationid = jfid;
                model.createtime    = DateTime.Now;
                model.sendtime      = DateTime.Now;
                model.founderid     = jfmodel.founderid;
                model.contents      = "名称为" + jfmodel.cname + "的单据需要您审批!";;
                EtNet_BLL.InformationManager.Add(model);
                int maxid = EtNet_BLL.InformationManager.GetMaxId(jfmodel.founderid.ToString());

                EtNet_Models.InformationNotice infnotic = new EtNet_Models.InformationNotice();
                infnotic.informationid = maxid;
                infnotic.recipientid   = recipientid;
                infnotic.remind        = "是";
                EtNet_BLL.InformationNoticeManager.Add(infnotic);
            }
        }