Пример #1
0
 public AdminController()
 {
     _product  = new ProductServise();
     _image    = new ImageServise();
     _type     = new TypeServise();
     _basetype = new BaseTypeServise();
 }
Пример #2
0
        public bool UpdateProduct(Product product)
        {
            ProductServise productServise = new ProductServise();
            bool           result         = productServise.UpdateProduct(product);

            return(result);
        }
Пример #3
0
        //
        // GET: /Product/

        public ActionResult Index()
        {
            ProductServise       productServise = new ProductServise();
            ProductListViewModel model          = new ProductListViewModel();

            model = productServise.GetProductViewModel();
            return(View("Product", model));
        }
Пример #4
0
        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"));
        }
Пример #5
0
 public HomeController()
 {
     _encript = new EncriptServises();
     _contact = new ContactServise();
     _product = new ProductServise();
 }