public ActionResult MakePolygraphyOrder(PolygraphyViewModel order) { try { var orderDto = new PolygraphyDTO { AdvertisingID = order.AdvertisingID, PhoneNumber = order.PhoneNumber, Amount = order.Amount }; orderService.MakePolygrahyOrder(orderDto); return(RedirectToAction("Index", "Home")); } catch (ValidationException ex) { ModelState.AddModelError(ex.Property, ex.Message); } return(View(order)); }
public ActionResult MakePolygraphyOrder(int?id) { try { AdvertisingDTO ad = orderService.GetAdvertising(id); var order = new PolygraphyViewModel { AdvertisingID = ad.ID }; return(View(order)); } catch (ValidationException ex) { return(Content(ex.Message)); } }