Exemple #1
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         int roleId = ConvertUtility.ToInt32(dropRole.SelectedValue);
         foreach (ListItem item in lstCommands.Items)
         {
             if (item.Selected && item.Value != "0")
             {
                 RoleController.AddCommandToRoleByPortalID(Convert.ToInt32(item.Value), roleId, ConvertUtility.ToInt32(dropPortal.SelectedValue));
             }
             else
             {
                 RoleController.RemoveCommandFromRoleByPortalID(Convert.ToInt32(item.Value), roleId, ConvertUtility.ToInt32(dropPortal.SelectedValue));
             }
         }
         lblUpdate.Text = MiscUtility.MSG_UPDATE_SUCCESS;
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
     lblUpdate1.Text = "";
 }