예제 #1
0
        private void InitForModify()
        {
            AutoRlyInfo defaultRly = AutoRly.GetDefaultRly();

            if (defaultRly != null)
            {
                this.TextBox1.Text   = defaultRly.MsgText;
                this.TextBox2.Text   = defaultRly.MediaPath;
                this.Image1.ImageUrl = defaultRly.MediaPath;
                this.Image1.Attributes.Add("data-original", defaultRly.MediaPath);
                this.TextBox3.Text = defaultRly.Description;
                this.TextBox4.Text = defaultRly.LinkUrl;
            }
        }
예제 #2
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (!base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         string      a           = "update";
         AutoRlyInfo autoRlyInfo = AutoRly.GetDefaultRly();
         if (autoRlyInfo == null)
         {
             a                   = "add";
             autoRlyInfo         = new AutoRlyInfo();
             autoRlyInfo.RlyType = "默认回复";
             autoRlyInfo.MsgKey  = "DefaultRly";
         }
         autoRlyInfo.MsgText       = WebUtils.GetString(this.TextBox1.Text);
         autoRlyInfo.MediaPath     = WebUtils.GetString(this.TextBox2.Text);
         autoRlyInfo.Description   = WebUtils.GetString(this.TextBox3.Text);
         autoRlyInfo.LinkUrl       = WebUtils.GetString(this.TextBox4.Text);
         autoRlyInfo.AutoTimeStamp = System.DateTime.Now;
         if (string.IsNullOrEmpty(autoRlyInfo.MsgText))
         {
             base.ShowMsg("文本内容不能为空");
         }
         else if ((a == "add" && AutoRly.Add(autoRlyInfo) > 0) || (a == "update" && AutoRly.Update(autoRlyInfo)))
         {
             PageBase.log.AddEvent(base.LoginAccount.AccountName, "更新默认回复成功");
             base.ShowMsg("Cập nhật thành công");
         }
         else
         {
             base.ShowMsg("Cập nhật thất bại");
         }
     }
 }