Example #1
0
        public ActionResult Delete(int id, BusinessLogicLayer.ProductBLL collection)
        {
            try
            {
                using (ContextBll ctx = new ContextBll())
                {
                    ctx.DeleteProduct(id);
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception Ex)
            {
                ViewBag.Exception = Ex;
                return(View("Error"));
            }
        }
Example #2
0
        public ActionResult Edit(int id, BusinessLogicLayer.ProductBLL collection)
        {
            try
            {
                // TODO: Add insert logic here
                using (ContextBll ctx = new ContextBll())
                {
                    ctx.UpdateProduct(collection);
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception Ex)
            {
                ViewBag.Exception = Ex;
                return(View("Error"));
            }
        }
Example #3
0
 public void DeleteProduct(ProductBLL Product)
 {
     _context.DeleteProduct(Product.ProductsID);
 }
Example #4
0
 public void UpdateProduct(ProductBLL product)
 {
     _context.UpdateProduct(product.ProductsID, product.CategoryID, product.SellerID, product.Name, product.Descrption, product.ReservePrice, product.WinningofferID, product.Comments, product.Photos, product.Categories, product.SellerEmail, product.SellerName);
 }