Exemple #1
0
 public void UpdateProduct(int pId, int pIdType, int pIdColor, int pIdBrand, int pIdProvider, int pIdCatalog, string pTitle, string pName, string pDescription, string pObservations, decimal pPriceDistributor, decimal pPriceClient, decimal pPriceMember, bool pIsEnabled, string pKeywords, DateTime pDateUpdate)
 {
     using (DataProductsEntities db = new DataProductsEntities())
     {
         db.JEVJ1_ActualizaProducto(pId, pIdType, pIdColor, pIdBrand, pIdProvider, pIdCatalog, pTitle, pName, pDescription, pObservations, pPriceDistributor, pPriceClient, pPriceMember, pIsEnabled, pKeywords, pDateUpdate);
     }
 }
Exemple #2
0
        public List <JEVJ1_BuscaProductoPorID_Result> GetProductById(int pId)
        {
            using (DataProductsEntities db = new DataProductsEntities())
            {
                List <JEVJ1_BuscaProductoPorID_Result> lstProd = new List <JEVJ1_BuscaProductoPorID_Result>();
                foreach (var item in db.JEVJ1_BuscaProductoPorID(pId))
                {
                    if (item.Id == pId)
                    {
                        JEVJ1_BuscaProductoPorID_Result pet = new JEVJ1_BuscaProductoPorID_Result();
                        pet.Id               = item.Id;
                        pet.IdType           = item.IdType;
                        pet.IdColor          = item.IdColor;
                        pet.IdBrand          = item.IdBrand;
                        pet.IdProvider       = item.IdProvider;
                        pet.IdCatalog        = item.IdCatalog;
                        pet.Title            = item.Title;
                        pet.Nombre           = item.Nombre;
                        pet.Description      = item.Description;
                        pet.Observations     = item.Observations;
                        pet.PriceDistributor = item.PriceDistributor;
                        pet.PriceClient      = item.PriceClient;
                        pet.PriceMember      = item.PriceMember;
                        pet.IsEnabled        = item.IsEnabled;
                        pet.Keywords         = item.Keywords;
                        pet.DateUpdate       = item.DateUpdate;

                        lstProd.Add(pet);
                    }
                }

                return(lstProd);
            }
        }
Exemple #3
0
        public List <Product> GetProducts()
        {
            using (DataProductsEntities db = new DataProductsEntities())
            {
                List <Product> lstProd = new List <Product>();
                foreach (var item in db.Products.ToList())
                {
                    Product pet = new Product();
                    pet.Id               = item.Id;
                    pet.IdType           = item.IdType;
                    pet.IdColor          = item.IdColor;
                    pet.IdBrand          = item.IdBrand;
                    pet.IdProvider       = item.IdProvider;
                    pet.IdCatalog        = item.IdCatalog;
                    pet.Title            = item.Title;
                    pet.Nombre           = item.Nombre;
                    pet.Description      = item.Description;
                    pet.Observations     = item.Observations;
                    pet.PriceDistributor = item.PriceDistributor;
                    pet.PriceClient      = item.PriceClient;
                    pet.PriceMember      = item.PriceMember;
                    pet.IsEnabled        = item.IsEnabled;
                    pet.Keywords         = item.Keywords;
                    pet.DateUpdate       = item.DateUpdate;

                    lstProd.Add(pet);
                }

                return(lstProd);
            }
        }