protected void Page_Load(object sender, EventArgs e)
        {
            roles = MADRoles.GetAllRoles();

            RoleRepeater.DataSource = roles;
            RoleRepeater.DataBind();
        }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         RoleRepeater.DataSource = UserService.LoadActiveRolls(SessionVariable.Current.Company.Id);
         RoleRepeater.DataBind();
     }
 }
 protected void RoleRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         Role role = roles[e.Item.ItemIndex];
         if (MADRoles.ExistUsersWithRole(role.RoleID))
         {
             ErrorLabel.Text = "There are exist users with this role. Delete this references< first.";
         }
         else
         {
             MADRoles.DeleteRole(role.RoleID);
             roles = MADRoles.GetAllRoles();
             RoleRepeater.DataSource = roles;
             RoleRepeater.DataBind();
         }
     }
 }