public ActionResult DeleteBus(DeleteBusViewModel model)
 {
     int cityId = (int)Session["City"];
     if (ModelState.IsValid)
     {
         try
         {
             busRepository.Delete(int.Parse(model.Bus));
             model.Bus = "";
             TempData["Success"] = "Запись удалена";
         }
         catch(Exception ex)
         {
             NLog.LogManager.GetCurrentClassLogger().Error(ex);
             ModelState.AddModelError("", "Ошибка при удалении записи. Повторите попытку позже");
         }
     }
     model.Buses = new List<SelectListItem>(busRepository.Get(x => x.CityId == cityId).Select(x => new SelectListItem { Value = x.Id.ToString(), Text = x.Number }));
     return View(model);
 }
        public ActionResult DeleteBus()
        {
            int cityId = (int)Session["City"];

            DeleteBusViewModel model = new DeleteBusViewModel
            {
                Buses = new List<SelectListItem>(busRepository.Get(x => x.CityId == cityId).Select(x => new SelectListItem {Value = x.Id.ToString(), Text = x.Number }))
            };
            return View(model);
        }