private void SaveOrders() { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { OrderFacade facade = new OrderFacade(uow); FacadeUpdateResult <OrderData> result = facade.SaveNewOrders(Orders); if (result.IsSuccessful) { List <object> ids = new List <object>(); foreach (OrderData savedOrder in result.ResultList) { ids.Add(savedOrder.Id); } // Retrieve order info after saving successful Orders = facade.RetrieveOrdersInfo(ids, new OrderInfoConverter()); // Clear cart if (!WebContext.Current.ApplicationOption.IsTestMode) { ClearCart(); } LoadOrderConfirmation(); // Send notification try { NotificationProcessor.SendOrderConfirmation(txtEmail.Text.Trim(), Orders); } catch (Exception ex) { ProcException(ex, "Order successful. But sending email failed. "); } } else { ProcUpdateResult(result.ValidationResult, result.Exception); } } }