Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
        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));
            }
        }