Пример #1
0
        protected void btnAceptar_Click(object sender, EventArgs e)
        {
            Rol rol = new Rol();

            if (intIdRol != -1)
            {
                rol.Cargar(intIdRol);
                rol.Nombre      = txtNombre.Text;
                rol.Descripcion = txtDescripcion.Text;
                rol.Automatico  = chkAutomatico.Checked;
                rol.Extranet    = chkExtranet.Checked;
                rol.Modificar();
            }
            else
            {
                rol.Nombre      = txtNombre.Text;
                rol.Descripcion = txtDescripcion.Text;
                rol.Automatico  = chkAutomatico.Checked;
                rol.Extranet    = chkExtranet.Checked;
                rol.Crear();
            }
            if (((Button)sender).Text == "Aceptar")
            {
                Response.Redirect("ListaRoles.aspx");
            }
            else
            {
                Response.Redirect("FuncionAddRol.aspx?IdRol=" + rol.Id.ToString() + "&From=abm");
            }
        }
Пример #2
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     rol.Modificar();
     Session.Remove("Rol");
     btnCancelar_Click(null, null);
 }