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 { }
            }
        }
Ejemplo n.º 3
0
 protected void SendEmail(string content,Guid receiverID)
 {
     CY.CSTS.Core.Business.Email email = new CY.CSTS.Core.Business.Email();
     email.SenderID = new Guid("e1db5af7-fd84-4a1f-8625-6d1e7b37580c");//管理员ID
     email.Content = content;
     email.SendTime = DateTime.Now;
     email.Status = 1;
     email.Annex = 2;
     email.Save();
     CY.CSTS.Core.Business.EmailAdditional emailAdd = new CY.CSTS.Core.Business.EmailAdditional();
     emailAdd.ReceiveStatus = 2;
     emailAdd.MailID = email.Id;
     emailAdd.ReceiverID = receiverID;
     emailAdd.Save();
 }
Ejemplo n.º 4
0
        protected void sendEmail(string Oper)
        {
            try
            {
                Guid comAppId = new Guid(hdMacId.Value);
                CY.CSTS.Core.Business.CommissionedApplication comAapp = CY.CSTS.Core.Business.CommissionedApplication.Load(comAppId);
                comAapp.AdmissibilityDes = tbDes.Value;
                CY.CSTS.Core.Business.User U = (CY.CSTS.Core.Business.User)Session["User"];
                if (U == null)
                {
                    lbErr.Text = "请先登录";
                }
                else
                {
                    CY.CSTS.Core.Business.Email email = new CY.CSTS.Core.Business.Email();
                    email.Annex = 2;
                    email.SenderID = U.Id;
                    if (Oper == "Unpass")
                    {
                        email.Content = "您好:<br>    您对单位:" + comAapp.UnitName + "的委托测试未接受,描述如下:" + tbDes.Value + "。请联系委托单位。";
                    }
                    if (Oper == "Pass")
                    {
                        email.Content = "您好:<br>    您对单位:" + comAapp.UnitName + "的委托测试已接受,描述如下:" + tbDes.Value + "。请联系委托单位。";
                    }
                    if (Oper == "complete")
                    {
                        email.Content = "您好:<br>    您对单位:" + comAapp.UnitName + "的委托测试已完成,请尽快评分。";
                    }
                    email.Status = 1;
                    email.CreateTime = System.DateTime.Now;
                    email.SendTime = System.DateTime.Now;
                    email.Save();

                    CY.CSTS.Core.Business.EmailAdditional emailAdd = new CY.CSTS.Core.Business.EmailAdditional();
                    emailAdd.MailID = email.Id;
                    emailAdd.ReceiverID = comAapp.CommissionedPerson;
                    emailAdd.ReceiveStatus = 2;
                    emailAdd.Save();
                }
            }
            catch (Exception ex)
            {

            }
        }
Ejemplo n.º 5
0
        protected void sendEmail(string Oper)
        {
            CY.CSTS.Core.Business.User U = (CY.CSTS.Core.Business.User)Session["User"];
            if (U == null)
            {
                lbErr.Text = "请先登录";
            }
            else
            {
                try
                {
                    Guid comAppId = new Guid(hdMacId.Value);
                    CY.CSTS.Core.Business.CommissionedApplication comAapp = CY.CSTS.Core.Business.CommissionedApplication.Load(comAppId);

                    CY.CSTS.Core.Business.Email email = new CY.CSTS.Core.Business.Email();
                    email.Annex = 2;
                    email.SenderID = U.Id;
                    if (Oper == "UnApp")
                    {
                        email.Content = "您好:<br>    " + comAapp.PersonName + "的测试委托已取消。";
                    }
                    if (Oper == "App")
                    {
                        email.Content = "您好:<br>    " + comAapp.UnitName + "有新的测试委托,请登录用户中心查看委托信息。";
                    }
                    if (Oper == "Reject")
                    {
                        string score = string.Empty;
                        if (rdHihg.Checked)
                        {
                            score = "满意";
                        }
                        else if (rdMid.Checked)
                        {
                            score = "较满意";
                        }
                        else if (rdLow.Checked)
                        {
                            score = "不满意";
                        }
                        email.Content = "您好:<br>    " + comAapp.UnitName + "您的测试委托已评价,评价为:" + score + "。请登录用户中心查看评价信息。";
                    }
                    email.Status = 1;
                    email.CreateTime = System.DateTime.Now;
                    email.SendTime = System.DateTime.Now;
                    email.Save();

                    IList<CY.CSTS.Core.Business.User> userList = getUserList();
                    for (int i = 0; i < userList.Count; i++)
                    {
                        CY.CSTS.Core.Business.EmailAdditional emailAdd = new CY.CSTS.Core.Business.EmailAdditional();
                        emailAdd.MailID = email.Id;
                        emailAdd.ReceiverID = userList[i].Id;
                        emailAdd.ReceiveStatus = 2;
                        emailAdd.Save();
                    }
                }
                catch (Exception ex)
                {
                }
            }
        }
Ejemplo n.º 6
0
        protected void sendEmail(Guid comappId)
        {
            CY.CSTS.Core.Business.User U = (CY.CSTS.Core.Business.User)Session["User"];

            try
            {

                CY.CSTS.Core.Business.CommissionedApplication comAapp = CY.CSTS.Core.Business.CommissionedApplication.Load(comappId);
                if (comAapp != null)
                {
                    CY.CSTS.Core.Business.Email email = new CY.CSTS.Core.Business.Email();
                    email.Annex = 2;
                    email.SenderID = U.Id;

                    email.Content = "您好:<br>    " + comAapp.UnitName + "有新的测试委托,请登录用户中心查看委托信息。";
                    email.Status = 1;
                    email.CreateTime = System.DateTime.Now;
                    email.SendTime = System.DateTime.Now;
                    email.Save();

                    IList<CY.CSTS.Core.Business.User> userList = getUserList(comappId);
                    for (int i = 0; i < userList.Count; i++)
                    {
                        CY.CSTS.Core.Business.EmailAdditional emailAdd = new CY.CSTS.Core.Business.EmailAdditional();
                        emailAdd.MailID = email.Id;
                        emailAdd.ReceiverID = userList[i].Id;
                        emailAdd.ReceiveStatus = 2;
                        emailAdd.Save();
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }