protected void acceptButton_Click(object sender, EventArgs e)
{
try
{
List<string> revokes = new List<string>();
//bool flag = false;
foreach (ListItem it in permisos_CBList.Items)
{
if (it.Selected == false)
{
revokes.Add(it.Text);
//flag = true;
}
}
List<string> grants = new List<string>();
foreach (ListItem it in otrosPermisos_CBList.Items)
{
if (it.Selected == true)
{
grants.Add(it.Text);
//flag = true;
}
}
/*if (flag)
{*/
BL.Rol rl = new Rol();
long rolId = rl.getRolID(descripciones_DDList.SelectedItem.Text);
AdministradordeSistema admin = new AdministradordeSistema();
Security sec = new Security();
long centro = sec.getCentroId(centros.Text);
admin.editarRol(rolId, descripciones_DDList.SelectedItem.Text, grants, revokes, centro);
Page.ClientScript.RegisterStartupScript(Page.GetType(), "alert", "alert('Rol Editado')", true);
setCheckBoxes();
/*}
else
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "alert", "alert('Rol No Editado')", true);
}*/
}
catch (Exception ex)
{
Session["Error_Msg"] = ex.Message;
Response.Redirect("~/Error.aspx", true);
}
}