Example #1
0
    protected void btnSumbit_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            bool isSucc = true;
            //新建
            if (this.btnSumbit.ImageUrl.IndexOf("imgNew1.gif") != -1)
            {
                isSucc = RoleEditControl1.AddNewRole();

                RoleEditControl1.ClearUI();
            }
            else//修改
            {
                isSucc = RoleEditControl1.UpdateRole();
                RoleEditControl1.ClearUI();
                this.btnSumbit.ImageUrl = "../../images/icon/imgNew1.gif";
            }
            if (isSucc == false)
            {
                this.HidNewRole.Value = "block";
            }
            else
            {
                this.HidNewRole.Value = "none";
            }
            BindRoles();
        }
        catch
        {
            this.PrintfError("数据访问失败!");
            return;
        }
    }
Example #2
0
 protected void grvRole_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         string roleName = (string)e.CommandArgument;
         if (e.CommandName == "imgBtnMod")
         {
             //修改
             this.btnSumbit.ImageUrl = "../../images/icon/img20.gif";
             SysRole oRole = SysRole.GetRole(roleName);
             RoleEditControl1.SetModifyUI(oRole);
             this.HidNewRole.Value = "block";
         }
         if (e.CommandName == "imgBtnDel")
         {
             SysRole role = new SysRole();
             role.RoleName = roleName;
             role.Delete();
             this.HidNewRole.Value = "none";
             BindRoles();
         }
     }
     catch
     {
         this.PrintfError("数据访问失败,请重试!");
         return;
     }
 }
Example #3
0
 protected void imgBtnReset_Click(object sender, ImageClickEventArgs e)
 {
     RoleEditControl1.ClearUI();
     this.btnSumbit.ImageUrl = "../../images/icon/imgNew1.gif";
 }