public ActionResult CitiesList(string symbols = "") { CityBs city = new CityBs(); List <CityModel> model = city.GetList().Where(c => c.Name.Contains(symbols)).Select(c => (CityModel)c).ToList(); return(PartialView("~/Views/Admin/_CitiesList.cshtml", model)); }
public ActionResult EditLibrary(EditLibraryModel model) { if (ModelState.IsValid) { LibraryBs bs = new LibraryBs(); var result = bs.Update((LibraryDTO)model); if (result.Code == BusinessLayer.OperationStatusEnum.Success) { TempData["OperationStatus"] = true; TempData["OpearionMessage"] = "Данные успешно обновлены"; } else { TempData["OperationStatus"] = false; TempData["OpearionMessage"] = result.Message; } return(RedirectToAction("Libraries", "Admin")); } CityBs citybs = new CityBs(); model.Cities = citybs.GetList().Select(c => (CityModel)c).ToList(); return(View(model)); }
public ActionResult EditCity(int id) { CityBs bs = new CityBs(); CityModel model = (CityModel)bs.GetById(id); return(View(model)); }
public ActionResult AddLibrary() { EditLibraryModel model = new EditLibraryModel(); CityBs bs = new CityBs(); model.Cities = bs.GetList().Select(c => (CityModel)c).ToList(); return(View(model)); }
public ActionResult EditLibrary(int id) { LibraryBs libbs = new LibraryBs(); EditLibraryModel model = (EditLibraryModel)libbs.GetById(id); CityBs bs = new CityBs(); model.Cities = bs.GetList().Select(c => (CityModel)c).ToList(); return(View(model)); }
public ActionResult DeleteCity(int id) { CityBs bs = new CityBs(); var result = bs.Delete(id); if (result.Code == BusinessLayer.OperationStatusEnum.Success) { TempData["OperationStatus"] = true; TempData["OpearionMessage"] = "Операция завершена упешно"; } else { TempData["OperationStatus"] = false; TempData["OpearionMessage"] = "Ошибка при выполнении операции"; } return(RedirectToAction("Cities", "Admin")); }
public ActionResult EditCity(CityModel model) { if (ModelState.IsValid) { CityBs bs = new CityBs(); var result = bs.Update((CityDTO)model); if (result.Code == BusinessLayer.OperationStatusEnum.Success) { TempData["OperationStatus"] = true; TempData["OpearionMessage"] = "Операция завершена упешно"; } else { TempData["OperationStatus"] = false; TempData["OpearionMessage"] = "Ошибка при выполнении операции"; } return(RedirectToAction("Cities", "Admin")); } return(View(model)); }