コード例 #1
0
ファイル: AddProduct.xaml.cs プロジェクト: SokolSib/FRANCE
 private void AddElm()
 {
     RepositoryProduct.Add(FormToVar());
     dataGrid1.DataContext = null;
     dataGrid1.DataContext = RepositoryProduct.Document.GetXElements("Product", "rec");
     ClearForm();
 }
コード例 #2
0
ファイル: W_Add_Product.xaml.cs プロジェクト: SokolSib/FRANCE
        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);
            }
        }
コード例 #3
0
 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));
 }