private void AddElm() { RepositoryProduct.Add(FormToVar()); dataGrid1.DataContext = null; dataGrid1.DataContext = RepositoryProduct.Document.GetXElements("Product", "rec"); ClearForm(); }
private void WorkerAddDoWork(object sender, DoWorkEventArgs e) { var product = (ProductType)e.Argument; RepositoryProduct.Add(product); if (RepositoryAccountUser.LoginedUser.Role.IsPermiss(Privelege.RedactStockCount)) { var stockReal = RepositoryStockReal.GetByProduct(product); RepositoryStockReal.AddAsNull(product.CustomerId, Config.IdEstablishment); RepositoryStockReal.UpdateProductCount(_stockRealCount, stockReal.CustomerId); } }
public ActionResult Create([Bind(Include = "ID,Name_Product,Description,Price,Link_Image,Category")] ProductEntity productEntity) { if (ModelState.IsValid) { using (Repository <ProductEntity> rep = new RepositoryProduct()) { rep.Add(productEntity); rep.SaveAll(); } return(RedirectToAction("Index")); } return(View(productEntity)); }