Beispiel #1
0
 public static Common.SmsTemplate LoadSmsTemplate(Guid smsTemplateGuid)
 {
     Business.SmsTemplate smsTemplateController = new Business.SmsTemplate();
     Common.SmsTemplate   smsTemplate           = new Common.SmsTemplate();
     smsTemplateController.Load(smsTemplateGuid, smsTemplate);
     return(smsTemplate);
 }
        private void InitializePage()
        {
            btnSave.Text   = Language.GetString(btnSave.Text);
            btnCancel.Text = Language.GetString(btnCancel.Text);
            btnSave.Attributes["onclick"] = "return validateRequiredFields();";

            if (ActionType == "edit")
            {
                Common.SmsTemplate smsTemplate = Facade.SmsTemplate.LoadSmsTemplate(SmsTemplateGuid);
                txtSmsBody.Text = smsTemplate.Body;
                //drpGroupTemplate.SelectedValue = smsTemplate.GroupTemplateGuid.ToString();
            }

            //if (ActionType == "insert" && RequestFromSmsBodyBox)
            //{
            //	txtSmsBody.Text = SmsBody.Replace("\\r\\n", "\n");
            //	txtSmsBody.Text = txtSmsBody.Text.Replace("\\n", "\n");
            //}
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Common.SmsTemplate smsTemplate = new Common.SmsTemplate();
            try
            {
                smsTemplate.SmsTemplateGuid = SmsTemplateGuid;
                smsTemplate.Body            = txtSmsBody.Text;
                smsTemplate.CreateDate      = DateTime.Now;
                smsTemplate.UserGuid        = UserGuid;
                switch (ActionType)
                {
                case "edit":
                    if (smsTemplate.HasError)
                    {
                        throw new Exception(smsTemplate.ErrorMessage);
                    }

                    if (!Facade.SmsTemplate.UpdateSmsTemplate(smsTemplate))
                    {
                        throw new Exception(Language.GetString("ErrorRecord"));
                    }
                    break;

                case "insert":
                    if (smsTemplate.HasError)
                    {
                        throw new Exception(smsTemplate.ErrorMessage);
                    }

                    if (!Facade.SmsTemplate.Insert(smsTemplate))
                    {
                        throw new Exception(Language.GetString("ErrorRecord"));
                    }
                    break;
                }
                ClientSideScript = string.Format("result('ok','{0}')", Language.GetString("InsertRecord"));
            }
            catch (Exception ex)
            {
                ClientSideScript = string.Format("result('error','{0}')", ex.Message);
            }
        }
Beispiel #4
0
 public bool UpdateSmsTemplate(Common.SmsTemplate smsTemplate)
 {
     return(base.ExecuteSPCommand("UpdateSmsTemplate", "@Guid", smsTemplate.SmsTemplateGuid,
                                  "@Body", smsTemplate.Body));
 }
Beispiel #5
0
 public static bool UpdateSmsTemplate(Common.SmsTemplate smsTemplate)
 {
     Business.SmsTemplate smsTemplateController = new Business.SmsTemplate();
     return(smsTemplateController.UpdateSmsTemplate(smsTemplate));
 }
Beispiel #6
0
 public static bool Insert(Common.SmsTemplate smsTemplate)
 {
     Business.SmsTemplate smsTemplateController = new Business.SmsTemplate();
     return(smsTemplateController.Insert(smsTemplate) != Guid.Empty ? true : false);
 }