Ejemplo n.º 1
0
        protected void noticeExpert(string type, Guid appId)
        {
            IList<CY.CSTS.Core.Business.StimulationExpertAssignment> expertList = CY.CSTS.Core.Business.StimulationExpertAssignment.SelectStimulationExpertAssignmentDynamic("[StimulationAppID]='" + appId + "'", "");
            CY.CSTS.Core.Business.Email email = new CY.CSTS.Core.Business.Email();
            email.Annex = 2;
            if (Session["User"] != null)
            {
                CY.CSTS.Core.Business.User U = (CY.CSTS.Core.Business.User)Session["User"];
                if (U != null)
                {
                    email.SenderID = U.Id;
                }
            }

            email.Content = "您好:有新的" + type + "激励考评申请表需要您评分,请尽快提交您的评分单.";
            email.Status = 1;
            email.CreateTime = System.DateTime.Now;
            email.SendTime = System.DateTime.Now;
            email.Save();
            for (int i = 0; i < expertList.Count; i++)
            {
                if (!HasThisExpert(expertList[i].ExpertID, type))
                {
                    CY.CSTS.Core.Business.EmailAdditional emailAdd = new CY.CSTS.Core.Business.EmailAdditional();
                    emailAdd.MailID = email.Id;

                    emailAdd.ReceiverID = expertList[i].ExpertID;
                    emailAdd.ReceiveStatus = 2;
                    emailAdd.Save();

                    try
                    {
                        CY.CSTS.Core.Business.User u = CY.CSTS.Core.Business.User.Load(expertList[i].ExpertID);
                        if (u != null && u.Phone != null)
                        {
                            CY.CSTS.Core.Business.Sendsms sms = new CY.CSTS.Core.Business.Sendsms();
                            sms.Content = "您好:有新的" + type + "激励考评申请表需要您评分,请登录站点www.csts.net,尽快提交您的评分单.";
                            sms.Phone = "" + u.Phone + "";
                            sms.Save();
                        }
                    }
                    catch { }

                    if (type == "单位")
                    {
                        UnitExpertList.Add(expertList[i].ExpertID);
                    }
                    else
                    {
                        SetExpertList.Add(expertList[i].ExpertID);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected void noticeExpert(string type, Guid appId)
        {
            IList<CY.CSTS.Core.Business.JointReviewExperts> expertList = CY.CSTS.Core.Business.JointReviewExperts.SelectJointReviewExpertsDynamic("[JointReviewID]='" + appId + "'", "");
            CY.CSTS.Core.Business.Email email = new CY.CSTS.Core.Business.Email();
            email.Annex = 2;
            if (Session["User"] != null)
            {
                CY.CSTS.Core.Business.User U = (CY.CSTS.Core.Business.User)Session["User"];
                if (U != null)
                {
                    email.SenderID = U.Id;
                }
            }

            email.Content = "您好:有新仪器:" + type + "的联合评议申请申请表需要您评分,请尽快提交您的评分单.";
            email.Status = 1;
            email.CreateTime = System.DateTime.Now;
            email.SendTime = System.DateTime.Now;
            email.Save();
            for (int i = 0; i < expertList.Count; i++)
            {
                CY.CSTS.Core.Business.EmailAdditional emailAdd = new CY.CSTS.Core.Business.EmailAdditional();
                emailAdd.MailID = email.Id;
                emailAdd.ReceiverID = expertList[i].ExpertID;
                emailAdd.ReceiveStatus = 2;
                emailAdd.Save();
                try
                {
                    CY.CSTS.Core.Business.User u = CY.CSTS.Core.Business.User.Load(expertList[i].ExpertID);
                    if (u != null && u.Phone != null)
                    {
                        CY.CSTS.Core.Business.Sendsms sms = new CY.CSTS.Core.Business.Sendsms();
                        sms.Content = "您好:有新仪器:" + type + "的联合评议申请表需要您评分,请登录站点www.csts.net,尽快提交您的评分单.";
                        sms.Phone = "" + u.Phone + "";
                        sms.Save();
                    }
                }
                catch { }
            }
        }