예제 #1
0
        protected void btn_add_Click(object sender, EventArgs e)
        {
            try
            {
                ConfigBSO configBSO = new ConfigBSO();
                Config config = configBSO.GetAllConfig(Language.language);

                MailBSO mailBSO = new MailBSO();
                mailBSO.EmailFrom = config.Email_from;

                EmailBSO emailBSO = new EmailBSO();
                DataTable table = emailBSO.GetEmailAll();


                string subject = txtTitle.Text;
                string body = txtRadFull.Html;

                for (int i = 0; i < table.Rows.Count; i++)
                    mailBSO.SendMail(table.Rows[i]["EmailAddress"].ToString(), subject, body);

                clientview.Text = "Thư đã được gửi đến danh sách Người dùng";

            }
            catch (Exception ex)
            {
                clientview.Text = ex.Message.ToString();
            }
        }
예제 #2
0
 public void ViewEmail()
 {
     EmailBSO emailBSO = new EmailBSO();
     DataTable table = emailBSO.GetEmailAll();
     commonBSO commonBSO = new commonBSO();
     commonBSO.FillToGridView(grvEmail, table);
 }
예제 #3
0
 private void initControl(int Id)
 {
     if (Id > 0)
     {
         btn_add.Visible = false;
         btn_edit.Visible = true;
         try
         {
             EmailBSO emailBSO = new EmailBSO();
             Email email = emailBSO.GetEmailById(Id);
             hddEmailID.Value = Convert.ToString(email.EmailID);
             txtEmailAddress.Text = email.EmailAddress;
             txtName.Text = email.Name;
         }
         catch (Exception ex)
         {
             clientview.Text = ex.Message.ToString();
         }
     }
     else
     {
         btn_add.Visible = true;
         btn_edit.Visible = false;
     }
 }
예제 #4
0
 protected void btn_add_Click(object sender, EventArgs e)
 {
     try
     {
         Email email = ReceiveHtml();
         EmailBSO emailBSO = new EmailBSO();
         emailBSO.CreateEmail(email);
         clientview.Text = String.Format(Resources.StringAdmin.AddNewsSuccessful);
     }
     catch (Exception ex)
     {
         clientview.Text = ex.Message.ToString();
     }
 }
예제 #5
0
        protected void grvEmail_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int Id = Convert.ToInt32(e.CommandArgument.ToString());
            string nName = e.CommandName.ToLower();
            switch (nName)
            {

                case "_edit":
                    Response.Redirect("~//Admin/editemail/" + Id + "/Default.aspx");
                    break;
                case "_delete":

                    EmailBSO emailBSO = new EmailBSO();
                    emailBSO.DeleteEmail(Id);
                    ViewEmail();
                    break;
            }
        }
예제 #6
0
 protected void btn_edit_Click(object sender, EventArgs e)
 {
     try
     {
         Email email = ReceiveHtml();
         EmailBSO emailBSO = new EmailBSO();
         emailBSO.UpdateEmail(email);
         clientview.Text = String.Format(Resources.StringAdmin.UpdateSuccessful, "Email: ", email.EmailAddress);
     }
     catch (Exception ex)
     {
         clientview.Text = ex.Message.ToString();
     }
 }