Beispiel #1
0
 public ActionResult Create(OnSiteRegistrationEditModel model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             using (var scope = new TransactionScope())
             {
                 var order = _customerRegistrationService.RegisterOnsiteCustomer(model);
                 scope.Complete();
                 if (order.DiscountedTotal > 0)
                 {
                     Response.RedirectUser("/Scheduling/EventCustomerList/Index?id=" + model.EventId + "&customerIdforAcceptPayment=" + order.CustomerId);
                     return(null);
                 }
                 Response.RedirectUser("/Scheduling/EventCustomerList/Index?id=" + model.EventId);
                 return(null);
             }
         }
         catch (Exception ex)
         {
             model = _eventPackageSelectorService.SetEventAndPackageDetail(model, model.EventId, Roles.Technician);
             model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("System Error:" + ex.Message);
             return(View(model));
         }
     }
     model = _eventPackageSelectorService.SetEventAndPackageDetail(model, model.EventId, Roles.Technician);
     return(View(model));
 }
Beispiel #2
0
 public Order RegisterCustomerOnSite(OnSiteRegistrationEditModel model)
 {
     using (var scope = new TransactionScope())
     {
         var order = _customerRegistrationService.RegisterOnsiteCustomer(model);
         scope.Complete();
         return(order);
     }
 }