Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        public NumberSeriesView GetNewModel()
        {
            var model = new NumberSeriesView();

            return(model);
        }