public ActionResult Edit(int id, PumpstationModel model) { try { var pumpStation = GetPumpStationForModel(model); pumpstationService.UpdatePumpstation(pumpStation); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Create(PumpstationModel model) { try { var pumpStation = GetPumpStationForModel(model); pumpstationService.AddNewPumpstation(pumpStation); return RedirectToAction("Index"); } catch { return View(); } }
private PumpStation GetPumpStationForModel(PumpstationModel model) { return new PumpStation() { Id = model.Id, PumpStationName = model.PumpStationName, Description = model.Description }; }