/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { RoleModel model = null; string alert = ""; if (hidOperate.Value == "Add") { logmodel.ProcessFlag = "insert"; model = PageHelper.GetModel<RoleModel>(pnlContent.Controls); if (roleBll.AddRole(model, logmodel)) { alert = "alert('" + Message.AddSuccess + "')"; } else { alert = "alert('" + Message.AddFailed + "')"; } } else if (hidOperate.Value == "Modify") { logmodel.ProcessFlag = "update"; model = PageHelper.GetModel<RoleModel>(pnlContent.Controls, ddlAcceptmsg, ddlDeleted); if (roleBll.UpdateRoleByKey(model, logmodel)) { alert = "alert('" + Message.UpdateSuccess + "')"; } else { alert = "alert('" + Message.UpdateFailed + "')"; } } ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "addOrUpDateRole", alert, true); PageHelper.CleanControlsValue(pnlContent.Controls); DataBind(); }
protected void Page_Load(object sender, EventArgs e) { PageHelper.ButtonControls(FuncList, pnlShowPanel.Controls, base.FuncListModule); if (ClientMessage == null) { ClientMessage = new Dictionary<string, string>(); ClientMessage.Add("RoleCodeNotNull", Message.RoleCodeNotNull); ClientMessage.Add("RoleExist", Message.RoleExist); ClientMessage.Add("RoleDeleteConfirm", Message.RoleDeleteConfirm); ClientMessage.Add("RoleDeleteCheck", Message.RoleDeleteCheck); ClientMessage.Add("ConfirmDisable", Message.ConfirmDisable); ClientMessage.Add("AtLastOneChoose", Message.AtLastOneChoose); } if (!base.IsPostBack) { ModuleCode.Value = Request.QueryString["ModuleCode"] == null ? "" : Request.QueryString["ModuleCode"].ToString(); logmodel.ProcessOwner = CurrentUserInfo.Personcode; logmodel.TransactionType = Request.QueryString["ModuleCode"] == null ? "" : Request.QueryString["ModuleCode"].ToString(); logmodel.LevelNo = "2"; logmodel.FromHost = Request.UserHostAddress; pager.CurrentPageIndex = 1; model = new RoleModel(); DataBind(); } string clientmsg = JsSerializer.Serialize(ClientMessage); Page.ClientScript.RegisterStartupScript(GetType(), "ClientMessage", "var Message=" + clientmsg + ";", true); }
/// <summary> /// 查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnQuery_Click(object sender, EventArgs e) { pager.CurrentPageIndex = 1; model = PageHelper.GetModel<RoleModel>(pnlContent.Controls); DataBind(); PageHelper.CleanControlsValue(pnlContent.Controls); }