Exemplo n.º 1
0
 public ActionResult MakeOrder(Parcel_InfoViewModel parcel_info)
 {
     try
     {
         var parcel_infoDto = new Parcel_InfoDTO {
             Address_of_Receiver = parcel_info.Address_of_Receiver, Address_of_Sender = parcel_info.Address_of_Sender, Parcel_SearchId = parcel_info.Parcel_SearchID
         };
         parcel_infoService.DoSearch(parcel_infoDto);
         return(Content("<h2>Посылка найдена</h2>"));
     }
     catch (ValidationException ex)
     {
         ModelState.AddModelError(ex.Property, ex.Message);
     }
     return(View(parcel_info));
 }
Exemplo n.º 2
0
        public ActionResult DoSearch(int?id)
        {
            try
            {
                Parcel_SearchDTO parcel_search = parcel_infoService.GetParcel_Search(id);
                var parcel_info = new Parcel_InfoViewModel {
                    Parcel_SearchID = parcel_search.Id
                };

                return(View(parcel_info));
            }
            catch (ValidationException ex)
            {
                return(Content(ex.Message));
            }
        }