Exemple #1
0
        // GET: Categories/Category/Edit
        public ActionResult Edit(int Id)
        {
            var CP     = new CategoryProcess();
            var Objeto = CP.Find(Id);

            return(View(Objeto));
        }
Exemple #2
0
        public ActionResult Delete(int id, Category category)
        {
            var cp = new CategoryProcess();

            cp.deleteCategory(id);
            return(RedirectToAction("Index"));
        }
Exemple #3
0
        public ActionResult Create(Category category)
        {
            var cp = new CategoryProcess();

            cp.insertCategory(category);
            return(RedirectToAction("Index"));
        }
Exemple #4
0
        public ActionResult Edit(Category category)
        {
            var cp = new CategoryProcess();

            cp.editCategory(category);
            return(RedirectToAction("Index"));
        }
Exemple #5
0
        public ActionResult Create()
        {
            CategoryProcess categoryService = new CategoryProcess();
            var             categories      = categoryService.GetAll();

            return(PartialView(categories));
        }
        // GET: Categories/Edit
        public ActionResult Edit(int id)
        {
            var cp  = new CategoryProcess();
            var cat = cp.Find(id);

            return(View(cat));
        }
        // GET: Categories/Category
        public ActionResult Index()
        {
            var cp    = new CategoryProcess();
            var lista = cp.SelectList();

            return(View(lista));
        }
Exemple #8
0
        public ActionResult Edit(Category CAT)
        {
            var CP = new CategoryProcess();

            CP.Edit(CAT);
            return(RedirectToAction("Index"));
        }
Exemple #9
0
        // GET: Categories/Category/Delete
        public ActionResult Delete(int Id)
        {
            var CP = new CategoryProcess();

            CP.Delete(Id);
            return(RedirectToAction("Index"));
        }
Exemple #10
0
        public ActionResult Create(Category CAT)
        {
            var CP = new CategoryProcess();

            CP.Insert(CAT);
            //Acá implementamos el borrado del caché. Borra todas las key del caché
            DataCache.Instance.Remove();
            return(RedirectToAction("Index"));
        }
Exemple #11
0
        // GET: Dealer/Create
        public ActionResult Create()
        {
            var category = new CategoryProcess().SelectList();
            var country  = new CountryProcess().SelectList();

            ViewBag.Category = new SelectList(category, "Id", "Name");
            ViewBag.Country  = new SelectList(country, "Id", "Name");

            return(View());
        }
Exemple #12
0
        // GET: Dealer/Edit/5
        public ActionResult Edit(int id)
        {
            var category = new CategoryProcess().SelectList();
            var country  = new CountryProcess().SelectList();

            ViewBag.Category = new SelectList(category, "Id", "Name", id);
            ViewBag.Country  = new SelectList(country, "Id", "Name", id);

            var cp = new DealerProcess();

            return(View(cp.findDealer(id)));
        }
Exemple #13
0
        public List <Category> CategoryList()
        {
            var lista = _cacheService.GetOrAdd(DataCacheSetting.CategoryDataCache.key,
                                               () =>
            {
                var cp = new CategoryProcess();
                return(cp.SelectList());
            },
                                               DataCacheSetting.CategoryDataCache.SlidingExpiration);

            return(lista);
        }
        public void CategoryListRemove()
        {
            _cacheServices.Remove(DataCacheSetting.Category.Key);

            var lista = _cacheServices.GetOrAdd(
                DataCacheSetting.Category.Key,
                () =>
            {
                var cp = new CategoryProcess();
                return(cp.SelectList());
            },
                DataCacheSetting.Category.SlidingExpiration);
        }
 public ActionResult Delete(int id, Category category)
 {
     try
     {
         var cp = new CategoryProcess();
         cp.deleteCategory(id);
         DataCache.Instance.CategoryListRemove();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemple #16
0
        private void btnKategoriIslemleriKategoriSil_Click(object sender, EventArgs e)
        {
            Category CatToDelete = (Category)lstKategoriIslemleriKategoriGoster.FocusedItem.Tag;

            if (CategoryProcess.DeleteObjectWithControl(CatToDelete))
            {
                MessageBox.Show("Kategori Silme İşlemi Başarılı");
                AllRefresh();
            }
            else
            {
                MessageBox.Show("Kategori Silme İşlemi BAŞARISIZ");
            }
        }
 public ActionResult Edit(Category category)
 {
     try
     {
         var cp = new CategoryProcess();
         cp.editCategory(category);
         DataCache.Instance.CategoryListRemove();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemple #18
0
        // GET: Dealers/Create
        public ActionResult Create()
        {
            var cp           = new CountryProcess();
            var listaCountry = cp.SelectList();

            ViewData["Country"] = listaCountry;

            var cp2           = new CategoryProcess();
            var listaCategory = cp2.SelectList();

            ViewData["Category"] = listaCategory;

            return(View());
        }
Exemple #19
0
        // GET: Dealers/Edit
        public ActionResult Edit(int id)
        {
            var dp     = new DealerProcess();
            var dealer = dp.Find(id);

            var cp           = new CountryProcess();
            var listaCountry = cp.SelectList();

            ViewData["Country"] = listaCountry;

            var cp2           = new CategoryProcess();
            var listaCategory = cp2.SelectList();

            ViewData["Category"] = listaCategory;

            return(View(dealer));
        }
Exemple #20
0
        // GET: Dealers/Details
        public ActionResult Details(int id)
        {
            var dp     = new DealerProcess();
            var dealer = dp.Find(id);

            var cp          = new CountryProcess();
            var nameCountry = cp.Find(dealer.CountryId);

            ViewData["Country"] = nameCountry.Name;

            var cp2          = new CategoryProcess();
            var nameCategory = cp2.Find(dealer.CategoryId);

            ViewData["Category"] = nameCategory.Name;

            return(View(dealer));
        }
Exemple #21
0
        // GET: Dealers/Dealer
        public ActionResult Index()
        {
            var dp    = new DealerProcess();
            var lista = dp.SelectList();

            var cp           = new CountryProcess();
            var listaCountry = cp.SelectList();

            ViewData["Country"] = listaCountry;

            var cp2           = new CategoryProcess();
            var listaCategory = cp2.SelectList();

            ViewData["Category"] = listaCategory;

            return(View(lista));
        }
Exemple #22
0
        //// GET: Products/Product
        //[Authorize]
        public ActionResult ProductList(int Category = -1)
        {
            if (User.Identity.IsAuthenticated == true)
            {
                var cookie = Request.Cookies[".AspNet.ApplicationCookie"].Value;
                var cp     = new CartProcess();
                var cart   = cp.Cookie(cookie);
                if (cart == null)
                {
                    ViewBag.Cantidad = 0;
                }

                else
                {
                    var cip           = new CartItemProcess();
                    var listaItems    = cip.FindByCartId(cart.Id);
                    var CantidadTotal = 0;
                    foreach (CartItem item in listaItems)
                    {
                        CantidadTotal = CantidadTotal + item.Quantity;
                    }
                    ViewBag.Cantidad = CantidadTotal;
                }
            }
            else
            {
                ViewBag.Cantidad = 0;
            }

            var cp2 = new CategoryProcess();
            var pp  = new ProductProcess();

            ViewData["Category"] = cp2.SelectList();
            var lista = new List <Product>();


            if (Category > -1)
            {
                lista = pp.SelectByCat(Category);
            }

            return(View(lista));
        }
Exemple #23
0
 private void btnKategoriIslemleriKategoriEkle_Click(object sender, EventArgs e)
 {
     if (btnKategoriIslemleriKategoriDuzenle_Kaydet.Text == "Düzenle")
     {
         Category Cat = new Category();
         Cat.Name        = txtKategoriIslemleriKategoriAdi.Text;
         Cat.Description = txtKategoriIslemleriKategoriAciklamasi.Text;
         if (CategoryProcess.SaveObjectWithControl(Cat))
         {
             MessageBox.Show("Kategori Ekleme İşlemi Başarılı");
             AllRefresh();
         }
         else
         {
             MessageBox.Show("Kategori Ekleme İşlemi BAŞARISIZ");
         }
     }
     else
     {
         MessageBox.Show("Lütfen Önce Düzenleme İşlemini Bitiriniz");
     }
 }
Exemple #24
0
 private void btnKategoriIslemleriKategoriDuzenle_Kaydet_Click(object sender, EventArgs e)
 {
     if (btnKategoriIslemleriKategoriDuzenle_Kaydet.Text == "Düzenle")
     {
         if (lstKategoriIslemleriKategoriGoster.FocusedItem != null)
         {
             btnKategoriIslemleriDuzenlemeIptal.Visible      = true;
             btnKategoriIslemleriKategoriDuzenle_Kaydet.Text = "Kaydet";
             btnKategoriIslemleriKategoriDuzenle_Kaydet.Tag  = lstKategoriIslemleriKategoriGoster.FocusedItem.Tag;
             Category CatToEdit = (Category)btnKategoriIslemleriKategoriDuzenle_Kaydet.Tag;
             txtKategoriIslemleriKategoriAdi.Text        = CatToEdit.Name;
             txtKategoriIslemleriKategoriAciklamasi.Text = CatToEdit.Description;
         }
         else
         {
             MessageBox.Show("Lütfen Düzenlemek İçin Kategori Seçiniz");
         }
     }
     else
     {
         btnKategoriIslemleriDuzenlemeIptal.Visible      = false;
         btnKategoriIslemleriKategoriDuzenle_Kaydet.Text = "Düzenle";
         Category CatToEdit = (Category)btnKategoriIslemleriKategoriDuzenle_Kaydet.Tag;
         CatToEdit.Name        = txtKategoriIslemleriKategoriAdi.Text;
         CatToEdit.Description = txtKategoriIslemleriKategoriAciklamasi.Text;
         if (CategoryProcess.UpdateObjectWithControl(CatToEdit))
         {
             MessageBox.Show("Kategori Düzenleme Başarılı");
             btnKategoriIslemleriKategoriDuzenle_Kaydet.Tag = null;
             lstKategoriIslemleriKategoriGosterDoldur();
         }
         else
         {
             MessageBox.Show("Kategori Düzenleme Başarısız");
         }
     }
 }
 public CategoryController()
 {
     process = new CategoryProcess();
 }
        public ActionResult Delete(int id)
        {
            var cp = new CategoryProcess();

            return(View(cp.findCategory(id)));
        }