Пример #1
0
		public virtual ActionResult Create(CityEditModel model)
		{
			if (!ModelState.IsValid)
			{
				return View(model);
			}

			var id = _cities.Add(model);

			return RedirectToAction(MVC.City.Edit(id));
		}
Пример #2
0
		public virtual ActionResult Edit(long id, CityEditModel model)
		{
			if (!ModelState.IsValid)
			{
				return View(model);
			}

			_cities.Edit(id, model);

			return RedirectToAction(MVC.City.Edit(id));
		}
Пример #3
0
		public void Edit(long id, CityEditModel model)
		{
			_cities.Update(id, model.EnglishName, model.RussianName, model.Position);
		}
Пример #4
0
		public long Add(CityEditModel model)
		{
			return _cities.Add(model.EnglishName, model.RussianName, model.Position);
		}