예제 #1
0
 public Rol_X_Usuario()
 {
     usuario = new UsuariosEn();
     rol     = new RolEn();
 }
예제 #2
0
 public Permiso_X_Rol()
 {
     rol = new RolEn();
     permiso = new PermisoEn();
 }
예제 #3
0
 public Rol_X_Usuario()
 {
     usuario = new UsuariosEn();
     rol = new RolEn();
 }
예제 #4
0
 public Rol_X_Menu()
 {
     rol = new RolEn();
     menu = new MenuEn();
 }
예제 #5
0
 public Permiso_X_Rol()
 {
     rol     = new RolEn();
     permiso = new PermisoEn();
 }
예제 #6
0
        public static void RegistrarRol(RolEn _rol)
        {
            try
            {
                using (SqlConnection con = DataBaseManager.OpenSqlDatabase(user, pass, servidor, baseDatos))
                {
                    using (SqlCommand command = con.CreateCommand())
                    {
                        command.CommandText = "sp_registrar_usuario";
                        command.CommandType = System.Data.CommandType.StoredProcedure;

                        command.Parameters.AddWithValue("@p_id_rol", _rol.Id_rol);
                        command.Parameters.AddWithValue("@p_desc_rol", _rol.Desc_rol);

                        command.ExecuteNonQuery();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #7
0
        public static List<RolEn> ConsultaRoles()
        {
            List<RolEn> response = new List<RolEn>();
            try
            {
                using (SqlConnection con = DataBaseManager.OpenSqlDatabase(user, pass, servidor, baseDatos))
                {
                    using (SqlCommand command = con.CreateCommand())
                    {
                        command.CommandText = "sp_consulta_roles";
                        command.CommandType = System.Data.CommandType.StoredProcedure;

                        using (SqlDataReader dr = command.ExecuteReader())
                        {
                            while (dr.Read())
                            {
                                RolEn tmp = new RolEn();

                                tmp.Desc_rol = dr["id_rol"].ToString() ?? string.Empty;
                                tmp.Id_rol = dr["DESC_ROL"] != DBNull.Value ? Convert.ToInt32(dr["id_rol"]) : 0;

                                response.Add(tmp);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return response;
        }
예제 #8
0
 public static void RegistrarRol(RolEn _rol)
 {
     try
     {
         ConsultasAd.RegistrarRol(_rol);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #9
0
 public Rol_X_Menu()
 {
     rol  = new RolEn();
     menu = new MenuEn();
 }