Exemplo n.º 1
0
 protected void btnSave_OnClick(object sender, EventArgs e)
 {
     if (ddl.SelectedValue == YeAdministratorId.ToString())
     {
         WebUtil.Alert("您无法修改自身的权限!");
     }
     else
     {
         var list = new List <int>();
         for (int i = 1; i < 12; i++)
         {
             var c = this.FindControl("cbx" + i.ToString()) as CheckBox;
             if (c.Checked)
             {
                 list.Add(i);
             }
         }
         if (AdministratorBll.UpdateAdminPower(YeAdministratorId, list))
         {
             AdministratorBll.AddAdminLog(new Ye_AdminLog()
             {
                 AdminID     = YeAdministratorId,
                 LogTypeName = LogType.修改权限.ToString(),
                 CreateTime  = DateTime.Now
             });
             WebUtil.AlertAndRedirect("权限更新成功!", "");
         }
     }
 }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CheckPower(AdminPower.分配权限管理);
         WebControlUtil.BindDropDownList(ddl, AdministratorBll.GetAdministrators().ToArray(), "Account", "AdministratorID");
         ddl.SelectedValue = YeAdministratorId.ToString();
         BindData(YeAdministratorId);
     }
 }