Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         string queryString = RequestHelper.GetQueryString <string>("Key");
         int    num         = RequestHelper.GetQueryString <int>("IsSystem");
         if (queryString != string.Empty)
         {
             base.CheckAdminPower("ReadEmailContent", PowerCheckType.Single);
             EmailContentInfo info = new EmailContentInfo();
             if (num == 0)
             {
                 info = EmailContentHelper.ReadCommonEmailContent(queryString);
             }
             else
             {
                 info = EmailContentHelper.ReadSystemEmailContent(queryString);
             }
             this.EmailTitle.Text    = info.EmailTitle;
             this.EmailContent.Value = info.EmailContent;
             if (info.Note != string.Empty)
             {
                 this.NotePlaceHolder.Visible = true;
                 this.Note.Text = info.Note;
             }
             else
             {
                 this.NotePlaceHolder.Visible = false;
             }
         }
     }
 }
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            base.CheckAdminPower("AddEmailSendRecord", PowerCheckType.Single);
            EmailContentInfo    info            = EmailContentHelper.ReadCommonEmailContent(this.Key.Text);
            EmailSendRecordInfo emailSendRecord = new EmailSendRecordInfo();

            emailSendRecord.Title                  = info.EmailTitle;
            emailSendRecord.Content                = info.EmailContent;
            emailSendRecord.IsSystem               = 0;
            emailSendRecord.EmailList              = this.ReadUserEmail(ControlHelper.GetCheckBoxListValue(this.UserGrade));
            emailSendRecord.OpenEmailList          = string.Empty;
            emailSendRecord.IsStatisticsOpendEmail = Convert.ToInt32(this.IsStatisticsOpendEmail.Text);
            emailSendRecord.Note       = this.Note.Text;
            emailSendRecord.SendStatus = 1;
            emailSendRecord.AddDate    = RequestHelper.DateNow;
            emailSendRecord.SendDate   = RequestHelper.DateNow;
            string alertMessage = ShopLanguage.ReadLanguage("AddOK");
            int    id           = EmailSendRecordBLL.AddEmailSendRecord(emailSendRecord);

            AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("EmailSendRecord"), id);
            AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl);
        }