protected void btnDelete_Click(object sender, EventArgs e) { string alert = ""; string actionFlag = this.hidOperate.Value.ToString().Trim(); //刪除 if (actionFlag == "Delete") { model.ReasonNo = txtReasonNo.Text.ToString().Trim(); if (bll.DeleteExceptByKey(model, logmodel) > 0) { alert = "alert('" + Message.DeleteSuccess + "')"; } else { alert = "alert('" + Message.DeleteFailed + "')"; } this.hidOperate.Value = ""; } Page.ClientScript.RegisterStartupScript(GetType(), "show", alert, true); pager.CurrentPageIndex = 1; PageHelper.CleanControlsValue(pnlContent.Controls); model = new ExceptReasonModel(); DataUIBind(); }
protected void pager_PageChanged(object sender, EventArgs e) { if (this.ProcessFlag.Value == "Condition") { model = PageHelper.GetModel<ExceptReasonModel>(pnlContent.Controls); } else { model = new ExceptReasonModel(); } DataUIBind(); }
protected void btnQuery_Click(object sender, EventArgs e) { if (this.hidOperate.Value == "Condition") { ProcessFlag.Value = "Condition"; model = PageHelper.GetModel<ExceptReasonModel>(pnlContent.Controls); } else { model = new ExceptReasonModel(); } pager.CurrentPageIndex = 1; DataUIBind(); hidOperate.Value = ""; }
protected void btnSave_Click(object sender, EventArgs e) { string activeFlag = hidOperate.Value.ToString().Trim(); hidOperate.Value = "Edit"; if (activeFlag == "Add") { logmodel.ProcessFlag = "insert"; model = PageHelper.GetModel<ExceptReasonModel>(pnlContent.Controls); model.UpdateDate = DateTime.Now; model.UpdateUser = CurrentUserInfo.Personcode; int flag = bll.InsertExceptByKey(model, logmodel); if (flag > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "show", "alert('" + Message.AddSuccess + "')", true); } else { Page.ClientScript.RegisterStartupScript(GetType(), "show", "alert('" + Message.AddFailed + "')", true); } } if (activeFlag == "Modify") { logmodel.ProcessFlag = "update"; model = PageHelper.GetModel<ExceptReasonModel>(pnlContent.Controls); model.UpdateDate = DateTime.Now; model.UpdateUser = CurrentUserInfo.Personcode; bool flag = bll.UpdateExceptByKey(model,logmodel); if (flag) { Page.ClientScript.RegisterStartupScript(GetType(), "show", "alert('" + Message.UpdateSuccess + "')", true); } else { Page.ClientScript.RegisterStartupScript(GetType(), "show", "alert('" + Message.UpdateFailed + "')", true); } } pager.CurrentPageIndex = 1; model = new ExceptReasonModel(); DataUIBind(); hidOperate.Value = ""; }
protected void btnEnable_Click(object sender, EventArgs e) { string alert = ""; string actionFlag = this.hidOperate.Value.ToString().Trim(); //生效 if (actionFlag == "Enable") { logmodel.ProcessFlag = "update"; model.UpdateDate = System.DateTime.Now; model.UpdateUser = CurrentUserInfo.Personcode; model.ReasonNo = txtReasonNo.Text.ToString().Trim(); model.EffectFlag = "Y"; if (bll.UpdateExceptByKey(model,logmodel)) { alert = "alert('" + Message.EnableSuccess + "')"; } else { alert = "alert('" + Message.EnableFailed + "')"; } this.hidOperate.Value = ""; } Page.ClientScript.RegisterStartupScript(GetType(), "show", alert, true); pager.CurrentPageIndex = 1; PageHelper.CleanControlsValue(pnlContent.Controls); model = new ExceptReasonModel(); DataUIBind(); }