Exemple #1
0
 protected void AddNewTemplate(object sender, EventArgs e)
 {
     entity         = new SMS_EMAIL_DB_Entities();
     tmp            = new tbl_Templates();
     tmp.Type       = ddlNewType.SelectedValue;
     tmp.Name       = txtNewName.Text;
     tmp.Text       = txtTextNew.Text;
     tmp.Created_At = DateTime.Now;
     tmp.Updated_At = DateTime.Now;
     entity.AddTotbl_Templates(tmp);
     entity.SaveChanges();
     BindGridView();
 }
 protected void AddNewTemplate(object sender, EventArgs e)
 {
     _text = txtTextNew.Text;
     if (ddlNewType.SelectedValue == "BULK_SMS_DYNAMIC" && !_text.Contains("{variable}"))
     {
         lblErrorN.Visible = true;
         return;
     }
     lblErrorN.Visible = false;
     entity            = new SMS_EMAIL_DB_Entities();
     tmp            = new tbl_Templates();
     tmp.Type       = ddlNewType.SelectedValue;
     tmp.Name       = txtNewName.Text;
     tmp.Text       = txtTextNew.Text;
     tmp.Created_At = DateTime.Now;
     tmp.Updated_At = DateTime.Now;
     entity.AddTotbl_Templates(tmp);
     entity.SaveChanges();
     BindGridView();
     txtNewName.Text          = string.Empty;
     txtTextNew.Text          = string.Empty;
     ddlNewType.SelectedValue = "SMS";
 }