// GET: Categories/Category/Edit public ActionResult Edit(int Id) { var CP = new CategoryProcess(); var Objeto = CP.Find(Id); return(View(Objeto)); }
public ActionResult Delete(int id, Category category) { var cp = new CategoryProcess(); cp.deleteCategory(id); return(RedirectToAction("Index")); }
public ActionResult Create(Category category) { var cp = new CategoryProcess(); cp.insertCategory(category); return(RedirectToAction("Index")); }
public ActionResult Edit(Category category) { var cp = new CategoryProcess(); cp.editCategory(category); return(RedirectToAction("Index")); }
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)); }
public ActionResult Edit(Category CAT) { var CP = new CategoryProcess(); CP.Edit(CAT); return(RedirectToAction("Index")); }
// GET: Categories/Category/Delete public ActionResult Delete(int Id) { var CP = new CategoryProcess(); CP.Delete(Id); return(RedirectToAction("Index")); }
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")); }
// 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()); }
// 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))); }
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()); } }
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()); } }
// 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()); }
// 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)); }
// 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)); }
// 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)); }
//// 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)); }
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"); } }
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))); }