예제 #1
0
    protected void ListaModuloAreaGridView_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int areamoduloId = Convert.ToInt32(e.CommandArgument);

        if (e.CommandName == "Eliminar")
        {
            try
            {
                ModuloBLL.DeleteModulo(areamoduloId);
                cargarListaModulosdeArea(AreadeModuloIdHiddenField.Value);
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "ErrorAlert", "alert('No se puede eliminar por que este modulo esta siendo utilizado');", true);
                log.Error("Error al eliminar el usuario con el id '", ex);
            }
        }
        if (e.CommandName == "Editar")
        {
            Session["ModuloId"]            = areamoduloId;
            Session["booleanHabilitaArea"] = "true";

            Response.Redirect("~/Administracion/Modulo/RegistrarModulo.aspx");
        }
    }
예제 #2
0
 protected void ListaModulos_GV_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Editar")
     {
         try
         {
             int id = Convert.ToInt32(e.CommandArgument);
             Response.Redirect("Modulo.aspx?id=" + id);
         }
         catch (Exception ex)
         { throw ex; }
     }
     if (e.CommandName == "Eliminar")
     {
         try
         {
             int id = Convert.ToInt32(e.CommandArgument);
             ModuloBLL.DeleteModulo(id);
             CargarLista();
         }
         catch (Exception ex)
         { throw ex; }
     }
 }