Exemple #1
0
 public ActionResult Create(ProductsCategoriesmolels collection)
 {
     try
     {
         using (ContextBll ctx = new ContextBll())
         {
             int catid = ctx.CreateCategories(collection.CategoryID, collection.Categorie);
             ctx.CreateProduct(collection.ProductsID, catid, collection.SellerID, collection.Name, collection.Descrption, collection.ReservePrice, collection.WinningofferID, collection.Comments, collection.Photos, collection.Categorie, "sellerName", "sellerName");
         }
         // TODO: Add insert logic
         return(RedirectToAction("Index", "Products"));
     }
     catch (Exception EX)
     {
         return(View());
     }
 }
Exemple #2
0
        public ActionResult Create(BusinessLogicLayer.ProductBLL collection)
        {
            try
            {
                // TODO: Add insert logic here
                using (ContextBll ctx = new ContextBll())
                {
                    ctx.CreateProduct(collection);
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception Ex)
            {
                ViewBag.Exception = Ex;
                return(View("Error"));
            }
        }