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"); } } }
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("修改失败"); } } } } }