public AdminController() { _product = new ProductServise(); _image = new ImageServise(); _type = new TypeServise(); _basetype = new BaseTypeServise(); }
public bool UpdateProduct(Product product) { ProductServise productServise = new ProductServise(); bool result = productServise.UpdateProduct(product); return(result); }
// // GET: /Product/ public ActionResult Index() { ProductServise productServise = new ProductServise(); ProductListViewModel model = new ProductListViewModel(); model = productServise.GetProductViewModel(); return(View("Product", model)); }
public ActionResult Delete(int id) { string controllerName = GetControlerName(); if (controllerName == "BaseType") { ProductServise _product = new ProductServise(); var elementID = _typeServise.GetAll(x => x.BaseTypeID == id); var productElement = _product.GetAll(x => x.Basetype == id); foreach (var item in productElement) { item.Basetype = 0; item.Type = 0; _product.Save(item); } foreach (var item in elementID) { _typeServise.DeleteById(item.ID); } } _Servise.DeleteById(id); return(Redirect("../Index?Curentpage=1")); }
public HomeController() { _encript = new EncriptServises(); _contact = new ContactServise(); _product = new ProductServise(); }