Ejemplo n.º 1
0
 /// <summary>
 /// 查詢
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void btnQuery_Click(object sender, EventArgs e)
 {
     pager.CurrentPageIndex = 1;
     newmodel = PageHelper.GetModel<RolesModel>(pnlContent.Controls);
     GridDataBind();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 存儲
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void btnSave_Click(object sender, EventArgs e)
 {
     model = PageHelper.GetModel<RolesModel>(pnlContent.Controls);
     string alert = "";
     logmodel.ProcessFlag = "insert";
     if (hidOperate.Value == "Add")
     {
         model.CreateDate = System.DateTime.Now;
         model.CreateUser = base.CurrentUserInfo.Personcode;
         if (rb.AddRoles(model,logmodel))
         {
             alert = "alert('" + Message.AddSuccess + "')";
         }
         else
         {
             alert = "alert('" + Message.AddFailed + "')";
         }
     }
     else if (hidOperate.Value == "Modify")
     {
         model.UpdateDate = System.DateTime.Now;
         model.UpdateUser = base.CurrentUserInfo.Personcode;
         if (rb.UpdateRolesByKey(model,logmodel))
         {
             alert = "alert('" + Message.UpdateSuccess + "')";
         }
         else
         {
             alert = "alert('" + Message.UpdateFailed + "')";
         }
     }
     ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "save", alert, true);
     PageHelper.CleanControlsValue(pnlContent.Controls);
     GridDataBind();
 }
Ejemplo n.º 3
0
 private void LoadMenu()
 {
     string rolescode = base.Request.QueryString["RolesCode"];
     if (!string.IsNullOrEmpty(rolescode))
     {
         RolesModel rolesModel = new RolesModel();
         rolesModel = rolesBll.GetRolesByKey(rolescode);
         this.DisableInfo.Value = rolesModel.Deleted;
     }
     else
     {
         rolescode = "";
     }
         DataTable dt_1 = rolesRoleBll.GetRoleIsExist(rolescode);
         DataTable dt_2 = rolesRoleBll.GetRoleNotExist(rolescode);
         this.UltraWebTreeRoleCode.Nodes.Clear();
         if (dt_1.Rows.Count > 0)
         {
             foreach (DataRow row in dt_1.Rows)
             {
                 this.UltraWebTreeRoleCode.Nodes.Add(base.CreateNode(Convert.ToString(row["rolecode"]), row["rolename"].ToString(), true, true));
             }
         }
         if (dt_2.Rows.Count > 0)
         {
             foreach (DataRow row in dt_2.Rows)
             {
                 this.UltraWebTreeRoleCode.Nodes.Add(base.CreateNode(Convert.ToString(row["rolecode"]), row["RoleName"].ToString(), false, true));
             }
         }
         this.UltraWebTreeRoleCode.ExpandAll();
 }