protected void Page_Load(object sender, EventArgs e) { if (null != Common.Common.NoHtml(Request.QueryString["action"])) { strAction = Common.Common.NoHtml(Request.QueryString["action"]); } if (null != Common.Common.NoHtml(Request.QueryString["id"])) { strID = Common.Common.NoHtml(Request.QueryString["id"]); } MsgAutoRuleDAL dal = new MsgAutoRuleDAL(); switch (strAction) { case "del": if (dal.UpdateMsgAutoRuleEnable(strID)) { strMessage = "操作成功!"; } else { strMessage = "操作失败!"; } break; default: break; } Response.Write(strMessage); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(Session["strSiteCode"].ToString()) && Session["strRoleCode"].ToString() != "ADMIN") { Response.Write("<script language=JavaScript>parent.location.href='../Index.aspx';</script>"); Response.End(); } if (!IsPostBack) { if (null != Common.Common.NoHtml(Request.QueryString["action"])) { strAction = Common.Common.NoHtml(Request.QueryString["action"]); } if (null != Common.Common.NoHtml(Request.QueryString["id"])) { strID = Common.Common.NoHtml(Request.QueryString["id"]); } MsgAutoRuleDAL dal = new MsgAutoRuleDAL(); switch (strAction) { case "del": if (dal.UpdateMsgAutoRuleEnable(strID)) { strMessage = "操作成功!"; } else { strMessage = "操作失败!"; } Response.Write(strMessage); Response.End(); break; default: break; } } }