private void CheckCertStatus() { if(Request.Form["id"]!=null && Request.Form["status"] != null) { bool sta = Request.Form["status"] == "1"; int id = Convert.ToInt32(Request.Form["id"]); CompanyCertificate.SetCheck(id, sta); if (sta)//���ͨ��������ϵͳ��Ϣ { CompanyCertificate cert = CompanyCertificate.Get(id); if (cert != null) { MailTempItem msgTemp = MailTemplates.GetTemplate("msg_sp_cert_checkpass"); Message msg = new Message(MessageType.CertValidMessage); msg.CompanyId = cert.CompanyId; msg.Title = String.Format(msgTemp.Subject,cert.Title); msg.Body = String.Format(msgTemp.Body,cert.Title); msg.Priority = MessagePriority.High; msg.Save(); } } Response.Write("true"); return; } Response.Write("false"); }
protected override void OnInit(EventArgs e) { base.OnInit(e); if (!Cookies.HasCookie("SP_REG_TEMP")) { Response.Redirect("join.aspx"); Response.End(); } MailSended = false; ComGuid = Cookies.GetCookieValue("SP_REG_TEMP", "guid"); ComEmail = Cookies.GetCookieValue("SP_REG_TEMP", "email"); ComName = Cookies.GetCookieValue("SP_REG_TEMP", "comname"); //���ͻ�ӭ��Ϣ MailTempItem msgTemp = MailTemplates.GetTemplate("msg_sp_welcome"); Message msg = new Message(MessageType.SystemNotice); msg.CompanyId = Convert.ToInt32(Cookies.GetCookieValue("SP_REG_TEMP", "id")); msg.Title = msgTemp.Subject; msg.Body = msgTemp.Body; msg.Priority = MessagePriority.Normal; msg.Save(); //���ͼ����ʼ� MailTempItem mailTemp = MailTemplates.GetTemplate("sp_join"); if (mailTemp != null) { string activeCode = GuidQueue.Create(GuidQueueType.SupplierActiveAccount, ComEmail); string[] args = new string[] { ComEmail, Cookies.GetCookieValue("SP_REG_TEMP", "pwd"), Cookies.GetCookieValue("SP_REG_TEMP", "name"), ComName, CrypticString.Encrypt("email="+ComEmail+"&guid="+activeCode,true) }; SmtpMail sm = SmtpMail.Instance; sm.AddRecipient(new string[] { ComEmail }); sm.Html = mailTemp.Html; sm.Subject = String.Format(mailTemp.Subject, args); sm.Body = String.Format(mailTemp.Body, args); MailSended = sm.Send(); if (!MailSended) { Log.AddLog(LogType.SystemLog, ComEmail, "����ע���ʼ�ʧ�ܣ�" + sm.ErrorMessage + ""); } } if (MailSended) { Cookies.RemoveCookie("SP_REG_TEMP"); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (Converted)//send mail { //���ͻ�ӭ��Ϣ MailTempItem msgTemp = MailTemplates.GetTemplate("msg_sp_welcome"); Message msg = new Message(MessageType.SystemNotice); msg.CompanyId = SupplierID; msg.Title = msgTemp.Subject; msg.Body = msgTemp.Body; msg.Priority = MessagePriority.Normal; msg.Save(); //��ӭ�ʼ� MailTempItem mailTemp = MailTemplates.GetTemplate("sp_welcome"); string[] args = new string[] { CurrentSupplier.Email, CurrentSupplier.GetDefaultPassword() }; SmtpMail sm = SmtpMail.Instance; sm.AddRecipient(new string[] { CurrentSupplier.Email }); sm.Html = mailTemp.Html; sm.Subject = String.Format(mailTemp.Subject, args); sm.Body = String.Format(mailTemp.Body, args); MailSended = sm.Send(); if (!MailSended) { Log.AddLog(LogType.SystemLog, CurrentSupplier.Email, "������ʱ��Ӧ�̻�ӭ�ʼ�ʧ�ܣ�" + sm.ErrorMessage + ""); } } }
private void DoEvaluation() { if (Request.Form["evalue"] == null || Request.Form["evalData"] == null) { Response.Write("false"); return; } short eval = Convert.ToInt16(Request.Form["evalue"]); string data = Request.Form["evalData"].Trim(); NameValueCollection nc = CrypticString.GetQueryString(data); string email = nc["email"] == null ? "" : nc["email"]; int comid = nc["comid"] == null ? 0 : Convert.ToInt32(nc["comid"]); int caseId = nc["caseid"] == null ? 0 : Convert.ToInt32(nc["caseid"]); CurrentCase = CompanyCase.Get(caseId, comid); { if (CurrentCase != null) { SupplierEvaluation spEval = new SupplierEvaluation(EvaluationType.Case, comid, caseId, eval, email, false); bool bln = spEval.Save(); //����ϵͳ��Ϣ MailTempItem msgTemp = MailTemplates.GetTemplate("msg_sp_case_evaluated"); Message msg = new Message(MessageType.SystemNotice); msg.CompanyId = comid; msg.Priority = MessagePriority.Normal; msg.Title = String.Format(msgTemp.Subject, email, CurrentCase.Title); msg.Body = String.Format(msgTemp.Body, email, CurrentCase.Title); msg.Save(); } } Response.Write("true"); }