// GET: Store public ActionResult Index() { var maneger = new StoreMenager(); List <Store> stores = maneger.GetAllStore(); return(View(stores)); }
public ActionResult Details(Store store) { var maneger = new StoreMenager(); maneger.Details(store); return(RedirectToAction("Details")); }
public ActionResult Details(int id) { var maneger = new StoreMenager(); var store = maneger.GetStoreById(id); return(View(store)); }
private void LoadDropDwon() { StoreMenager storeMenager = new StoreMenager(); List <Store> stores = storeMenager.GetAllStore(); ViewBag.Stores = new SelectList(stores, "StoreId", "StoreName"); MovieManeger movieManeger = new MovieManeger(); List <Movie> movies = movieManeger.GetAllMovies(); ViewBag.MovieTitle = new SelectList(movies, "ID", "Title"); }
public ActionResult Create() { StoreMenager maneger = new StoreMenager(); List <Store> stores = maneger.GetAllStore(); ViewBag.Store = new SelectList(stores, "StoreId", "StoreName"); MovieManeger movieManeger = new MovieManeger(); List <Movie> movies = movieManeger.GetAllMovies(); ViewBag.Movie = new SelectList(movies, "ID", "Title"); return(View()); }
public ActionResult Delete(Store store) { var maneger = new StoreMenager(); bool delete = maneger.DeleteStore(store); if (delete) { TempData["Delete"] = "Store Successfully Deleted.."; return(RedirectToAction("Index")); } else { TempData["Error"] = "Store Can't Delete.."; return(View(store)); } }
public ActionResult Edit(Store store) { var maneger = new StoreMenager(); bool update = maneger.UpdateStore(store); if (update) { TempData["Update"] = "Store Successfully Updated.."; return(RedirectToAction("Index")); } else { TempData["Error"] = "Store Can't Updated.."; return(View(store)); } }
public ActionResult Create(Store store) { store.StoreName = store.StoreName; store.Address = store.Address; store.City = store.City; store.ZipCode = store.ZipCode; store.Country = store.Country; var maneger = new StoreMenager(); bool saved = maneger.InsertStore(store); if (saved) { TempData["Success"] = "Data Save Successfully"; return(RedirectToAction("Index")); } else { TempData["Error"] = "Data Can't Inserted"; return(View(store)); } }