public ActionResult GiongCho(String Metatitle) { var choCanh = new GiongPetRepository().GetGiongPet(Metatitle); ViewBag.Item = new PetRepository().ListPetByGiongPetMetatitle(Metatitle); return(View(choCanh)); }
public ActionResult Delete(int id) { var giongPetRepo = new GiongPetRepository(); giongPetRepo.Delete(id); return(RedirectToAction("Index")); }
// GET: Admin/GiongPet public ActionResult Index(String searchString, int page = 1, int pagesize = 10) { var giongPetRepo = new GiongPetRepository(); var model = giongPetRepo.ListAllPaging(searchString, page, pagesize); return(View(model)); }
public ActionResult Edit(int id) { var giongPetRepo = new GiongPetRepository(); var giongPet = giongPetRepo.GetByID(id); SetViewBag(giongPet.ID_DanhMuc); return(View(giongPet)); }
public ActionResult Create(GiongPet giongPet) { int x = giongPet.ID_GiongPet; var giongPetRepo = new GiongPetRepository(); int id = giongPetRepo.InsertOrUpdate(giongPet); if (ModelState.IsValid) { if (id > 0) { return(RedirectToAction("Index", "GiongPet")); } else { ModelState.AddModelError("", "Thêm Giống Pet không thành công"); } } SetViewBag(); return(View("index")); }
public PartialViewResult ThuCungCategory() { var model = new GiongPetRepository().ListAll(); return(PartialView(model)); }
public void SetViewBag(int?selectedID = null) { var repo = new GiongPetRepository(); ViewBag.ID_GiongPet = new SelectList(repo.ListAll(), "ID_GiongPet", "TenGiongPet", selectedID); }