Exemple #1
0
 public ActionResult Edit([Bind(Include = "ID,Name_Product,Description,Price,Link_Image,Category")] ProductEntity productEntity)
 {
     if (ModelState.IsValid)
     {
         using (Repository <ProductEntity> rep = new RepositoryProduct())
         {
             rep.Update(productEntity);
             rep.SaveAll();
         }
         return(RedirectToAction("Index"));
     }
     return(View(productEntity));
 }
        private void WorkerEditDoWork(object sender, DoWorkEventArgs e)
        {
            var product = (ProductType)e.Argument;

            RepositoryProduct.Update(product);
            RepositoryProduct.UpdateProductPrice(product);

            if (RepositoryAccountUser.LoginedUser.Role.IsPermiss(Privelege.RedactStockCount))
            {
                var stockReal = RepositoryStockReal.GetByProduct(product);
                RepositoryStockReal.UpdateProductCount(_stockRealCount, stockReal.CustomerId);
            }
        }
Exemple #3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            IRepositoryGeneric <Product> repositoryProduct = new RepositoryProduct();

            if (productToBeChanged == null)
            {
                Product newProduct = new Product
                {
                    Name    = txbProductName.Text.Trim(),
                    BrandId = Convert.ToInt32(cmbBrands.SelectedValue)
                };
                repositoryProduct.Insert(newProduct);
            }
            else
            {
                productToBeChanged.Name    = txbProductName.Text;
                productToBeChanged.BrandId = Convert.ToInt32(cmbBrands.SelectedValue);
                repositoryProduct.Update(productToBeChanged);
            }
            Close();
        }
Exemple #4
0
        public EntityProduct Update(Material model, EntityProduct prod)
        {
            var objRepository = new RepositoryProduct();

            EntityProduct data = new EntityProduct()
            {
                PK_ProductID        = prod.PK_ProductID,
                Model               = model.IDMaterial,
                ProductName         = model.DescripcionRefaccion,
                SaleOrganization    = model.OrganizacionVentas,
                DistributionChannel = model.CanalDistribucion,
                Center              = model.Centro,
                MaterialGroup1      = model.GrupoMaterial1,
                MaterialGroup4      = model.GrupoMaterial4,
                ProductType         = model.TipoProducto,
                BarCode             = prod.BarCode,
                Status              = prod.Status,
                CreateDate          = prod.CreateDate,
                ModifyDate          = DateTime.UtcNow
            };

            data = objRepository.Update(data);
            return(data);
        }
 private void ModifElm()
 {
     RepositoryProduct.Update(FormToVar());
 }