public static object GetByUserId(Usuario usuario)
        {
            var param = new List <SPParameter>
            {
                new SPParameter("ID_Usuario", usuario.ID)
            };

            var sp = new StoreProcedure(DataBaseConst.Calificacion.SPGetCalificationByUserId, param);

            Double calification = 0.0;
            var    reader       = sp.ExecuteReader(null);

            while (reader.Read())
            {
                calification = Convert.ToDouble(reader[0]);
            }

            if (!reader.IsClosed)
            {
                reader.Close();
            }

            return(calification);
        }
Пример #2
0
        public static List <Publicacion> GetAllActive()
        {
            //Obtengo la publicacion que se encuentren activas
            var param = new List <SPParameter>
            {
                new SPParameter("Fecha_hoy", Configuration.ConfigurationVariables.FechaSistema)
            };

            var sp = new StoreProcedure(DataBaseConst.Publicacion.SPGetAllActive, param);

            var publications = sp.ExecuteReader <Publicacion>();

            if (publications == null || publications.Count == 0)
            {
                return(null);
            }

            foreach (var pub in publications)
            {
                pub.GetObjectsById();
            }

            return(publications);
        }
Пример #3
0
        public static List <Publicacion> GetFinishedAuctions()
        {
            //Obtengo la lista de publicaciones que ya hayan vencido para pasarlas a compras
            var param = new List <SPParameter>
            {
                new SPParameter("Fecha_Hoy", ConfigurationVariables.FechaSistema)
            };

            var sp = new StoreProcedure(DataBaseConst.Publicacion.SPGetFinishedAuctions, param);

            var publications = sp.ExecuteReader <Publicacion>();

            if (publications == null || publications.Count == 0)
            {
                return(new List <Publicacion>());
            }

            foreach (var pub in publications)
            {
                pub.GetObjectsById();
            }

            return(publications);
        }
Пример #4
0
        public static int GetAllActiveAndFreeByUser(int userId)
        {
            var param = new List <SPParameter>
            {
                new SPParameter("ID_Usuario", userId)
            };

            var quantity = 0;
            var sp       = new StoreProcedure(DataBaseConst.Publicacion.SPGetAllActiveAndFreeByUserId, param);

            var reader = sp.ExecuteReader(null);

            while (reader.Read())
            {
                quantity = Convert.ToInt32(reader[0]);
            }

            if (!reader.IsClosed)
            {
                reader.Close();
            }

            return(quantity);
        }
        public static List <FormaPago> GetAll()
        {
            var sp = new StoreProcedure(DataBaseConst.FormaPago.SPGetAllFormaPago);

            return(sp.ExecuteReader <FormaPago>());
        }
Пример #6
0
        public static List <TipoDocumento> GetAll()
        {
            var sp = new StoreProcedure(DataBaseConst.TipoDocumento.SPGetAllTipoDocumento);

            return(sp.ExecuteReader <TipoDocumento>());
        }
Пример #7
0
        public static List <Cliente> GetAllClients()
        {
            var sp = new StoreProcedure(DataBaseConst.Cliente.SPGetAllClients);

            return(sp.ExecuteReader <Cliente>());
        }
Пример #8
0
        public static List <Rubro> GetAll()
        {
            var sp = new StoreProcedure(DataBaseConst.Rubro.SPGetAllRubro);

            return(sp.ExecuteReader <Rubro>());
        }
        public List <Especialidad> GetAll()
        {
            StoreProcedure sp = new StoreProcedure(DataBaseConst.Especialidad.SP_GetAllEspecialidad);

            return(sp.ExecuteReader <Especialidad>());
        }
Пример #10
0
        public static List <Empresa> GetAllBusiness()
        {
            var sp = new StoreProcedure(DataBaseConst.Empresa.SPGetAllBusiness);

            return(sp.ExecuteReader <Empresa>());
        }
Пример #11
0
        public List <Rol> GetAll()
        {
            StoreProcedure sp = new StoreProcedure(DataBaseConst.Rol.SP_GetAllRol);

            return(sp.ExecuteReader <Rol>());
        }
        public List <EstadoCivil> GetAll()
        {
            StoreProcedure sp = new StoreProcedure(DataBaseConst.EstadoCivil.SP_GetAllEstadoCivil);

            return(sp.ExecuteReader <EstadoCivil>());
        }
Пример #13
0
        public List <PlanMedico> GetAll()
        {
            StoreProcedure sp = new StoreProcedure(DataBaseConst.PlanMedico.SP_GetAllPlanMedico);

            return(sp.ExecuteReader <PlanMedico>());
        }
Пример #14
0
        public List <Funcionalidad> GetAll()
        {
            StoreProcedure sp = new StoreProcedure(DataBaseConst.Funcionalidad.SP_GetAllFuncionalidad);

            return(sp.ExecuteReader <Funcionalidad>());
        }