public void Save(NumberSeriesView viewTable) { if (viewTable.Id == null) { var domainTable = new NumberSeriesTable(); Mapper.Map(viewTable, domainTable); SaveDomain(domainTable); } else { var domainTable = Find(viewTable.Id); Mapper.Map(viewTable, domainTable); SaveDomain(domainTable); } }
public ActionResult Edit(NumberSeriesView model) { if (ModelState.IsValid) { try { _Service.Save(model); return(RedirectToAction("Index")); } catch (Exception e) { ModelState.AddModelError(string.Empty, e.GetOriginalException().Message); } } return(View(model)); }
public NumberSeriesView GetNewModel() { var model = new NumberSeriesView(); return(model); }