Пример #1
0
 public ActionResult Create(DeliveryModel model)
 {
     if (ModelState.IsValid)
     {
         var entity = model.MapTo <Delivery>();
         _deliveryService.InsertDelivery(entity);
         return(RedirectToAction("List"));
     }
     return(View(model));
 }
Пример #2
0
 public ActionResult Edit(DeliveryModel model)
 {
     if (ModelState.IsValid)
     {
         var entity = _deliveryService.GetDelivery(model.Id);
         entity = model.MapTo <DeliveryModel, Delivery>(entity);
         _deliveryService.UpdateDelivery(entity);
         return(RedirectToAction("List"));
     }
     return(View(model));
 }