Exemplo n.º 1
0
 protected void lnk_Delete_Click(object sender, System.EventArgs e)
 {
     if (!base.IsAuthorizedOp(ActionType.Delete.ToString()))
     {
         base.ShowAjaxMsg(this.UpdatePanel1, "Không có thẩm quyền");
     }
     else
     {
         int         @int     = WebUtils.GetInt((sender as LinkButton).CommandArgument);
         AutoRlyInfo dataById = AutoRly.GetDataById(@int);
         if (dataById == null)
         {
             base.ShowAjaxMsg(this.UpdatePanel1, "Những thông tin này không được tìm thấy, các dữ liệu không tồn tại hoặc đã bị xóa");
         }
         else if (AutoRly.Delete(@int))
         {
             this.BindData();
             PageBase.log.AddEvent(base.LoginAccount.AccountName, "删除自动回复关键字[" + dataById.MsgKey + "] thành công");
             base.ShowAjaxMsg(this.UpdatePanel1, "Thao tác thành công");
         }
         else
         {
             base.ShowAjaxMsg(this.UpdatePanel1, "Thao tác thất bại");
         }
     }
 }
Exemplo n.º 2
0
        private void BindData()
        {
            int    recordCount = 0;
            int    num         = 0;
            string strSort     = " AutoID DESC ";

            this.SinGooPager1.PageSize = WebUtils.GetInt(this.drpPageSize.SelectedValue);
            this.Repeater1.DataSource  = AutoRly.GetPagerList(this.GetCondition(), strSort, this.SinGooPager1.PageIndex, this.SinGooPager1.PageSize, ref recordCount, ref num);
            this.Repeater1.DataBind();
            this.SinGooPager1.RecordCount = recordCount;
        }
Exemplo n.º 3
0
        private void InitForModify()
        {
            AutoRlyInfo focusRly = AutoRly.GetFocusRly();

            if (focusRly != null)
            {
                this.TextBox1.Text   = focusRly.MsgText;
                this.TextBox2.Text   = focusRly.MediaPath;
                this.Image1.ImageUrl = focusRly.MediaPath;
                this.Image1.Attributes.Add("data-original", focusRly.MediaPath);
                this.TextBox3.Text = focusRly.Description;
                this.TextBox4.Text = focusRly.LinkUrl;
            }
        }
Exemplo n.º 4
0
        private void InitForModify()
        {
            AutoRlyInfo dataById = AutoRly.GetDataById(base.OpID);

            if (dataById != null)
            {
                this.TextBox5.Text   = dataById.MsgKey;
                this.TextBox1.Text   = dataById.MsgText;
                this.TextBox2.Text   = dataById.MediaPath;
                this.Image1.ImageUrl = dataById.MediaPath;
                this.Image1.Attributes.Add("data-original", dataById.MediaPath);
                this.TextBox3.Text = dataById.Description;
                this.TextBox4.Text = dataById.LinkUrl;
            }
        }
Exemplo n.º 5
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.GetFocusRly();
         if (autoRlyInfo == null)
         {
             a                   = "add";
             autoRlyInfo         = new AutoRlyInfo();
             autoRlyInfo.RlyType = "关注回复";
             autoRlyInfo.MsgKey  = "FoucusRly";
         }
         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("Thao tác thành công");
         }
         else
         {
             base.ShowMsg("Thao tác thất bại");
         }
     }
 }
Exemplo n.º 6
0
 protected void btn_DelBat_Click(object sender, System.EventArgs e)
 {
     if (!base.IsAuthorizedOp(ActionType.Delete.ToString()))
     {
         base.ShowAjaxMsg(this.UpdatePanel1, "Không có thẩm quyền");
     }
     else
     {
         string repeaterCheckIDs = base.GetRepeaterCheckIDs(this.Repeater1, "chk", "autoid");
         if (!string.IsNullOrEmpty(repeaterCheckIDs))
         {
             if (AutoRly.Delete(repeaterCheckIDs))
             {
                 this.BindData();
                 PageBase.log.AddEvent(base.LoginAccount.AccountName, "批量删除自动回复关键字成功");
                 base.ShowAjaxMsg(this.UpdatePanel1, "Thao tác thành công");
             }
             else
             {
                 base.ShowAjaxMsg(this.UpdatePanel1, "Thao tác thất bại");
             }
         }
     }
 }
Exemplo n.º 7
0
        private void InitForModify()
        {
            WxMenuInfo dataById = WxMenu.GetDataById(base.OpID);

            this.InitMenuType = dataById.Type;
            ListItem listItem = this.parentmenu.Items.FindByValue(dataById.ParentID.ToString());

            if (listItem != null)
            {
                listItem.Selected = true;
            }
            this.parentmenu.Enabled = false;
            this.menuname.Text      = dataById.Name;
            ListItem listItem2 = this.menutype.Items.FindByValue(dataById.Type);

            if (listItem2 != null)
            {
                listItem2.Selected = true;
            }
            if (dataById.Type == "click" && !string.IsNullOrEmpty(dataById.EventKey))
            {
                AutoRlyInfo eventRly = AutoRly.GetEventRly(dataById.EventKey);
                if (eventRly != null)
                {
                    this.TextBox1.Text   = eventRly.MsgText;
                    this.TextBox2.Text   = eventRly.MediaPath;
                    this.Image1.ImageUrl = eventRly.MediaPath;
                    this.TextBox3.Text   = eventRly.Description;
                    this.TextBox4.Text   = eventRly.LinkUrl;
                }
            }
            else
            {
                this.TextBox4.Text = dataById.Url;
            }
        }
Exemplo n.º 8
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
     {
         AutoRlyInfo autoRlyInfo = new AutoRlyInfo();
         if (base.IsEdit)
         {
             autoRlyInfo = AutoRly.GetDataById(base.OpID);
         }
         autoRlyInfo.RlyType       = "关键字回复";
         autoRlyInfo.MsgKey        = WebUtils.GetString(this.TextBox5.Text);
         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 (base.Action.Equals(ActionType.Add.ToString()))
             {
                 if (AutoRly.Add(autoRlyInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加微信自动回复关键字[" + autoRlyInfo.MsgKey + "] thành công");
                     base.Response.Redirect(string.Concat(new object[]
                     {
                         "MessageKeyRly.aspx?CatalogID=",
                         base.CurrentCatalogID,
                         "&Module=",
                         base.CurrentModuleCode,
                         "&action=View"
                     }));
                 }
                 else
                 {
                     base.ShowMsg("添加失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (AutoRly.Update(autoRlyInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改微信自动回复关键字[" + autoRlyInfo.MsgKey + "] thành công");
                     base.Response.Redirect(string.Concat(new object[]
                     {
                         "MessageKeyRly.aspx?CatalogID=",
                         base.CurrentCatalogID,
                         "&Module=",
                         base.CurrentModuleCode,
                         "&action=View"
                     }));
                 }
                 else
                 {
                     base.ShowMsg("修改失败");
                 }
             }
         }
     }
 }