public List <Rol> ListaRol()
 {
     try
     {
         RolDA roles = new RolDA();
         return(roles.ListaRol());
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Example #2
0
        public int ActualizarRol(Rol oRol, List <RolPagina> ListaRolPagina)
        {
            int resultado = -1;

            try
            {
                using (TransactionScope trans = new TransactionScope())
                {
                    resultado = new RolDA().EliminarRol(oRol.IdRol);
                    resultado = new RolDA().ActualizarRol(oRol);
                    if (resultado != -1 && resultado != 0)
                    {
                        foreach (RolPagina item in ListaRolPagina)
                        {
                            item.IdRol           = oRol.IdRol;
                            item.UsuarioCreacion = oRol.UsuarioCreacion;

                            resultado = new RolDA().InsertarRolPagina(item);
                            if (resultado == 0)
                            {
                                throw new Exception();
                            }
                        }
                    }
                    else
                    {
                        throw new Exception();
                    }

                    trans.Complete();
                    return(resultado);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
 public RolBL()
 {
     rolDA = new RolDA();
 }