Exemplo n.º 1
0
        public StoreCustomerResponse StoreCustomer(StoreCustomerRequest request)
        {
            if (!HttpContext.Current.User.Identity.IsAuthenticated)
                throw new FaultException<NotAuthenticatedFault>(new NotAuthenticatedFault());
            StoreCustomerResponse response = new StoreCustomerResponse();
            CustomerBusinessComponent bc = DependencyInjectionHelper.GetCustomerBusinessComponent();
            Customer customer = CustomerAdapter.DtoToCustomer(request.Customer);
            IEnumerable<ChangeItem> changeItems = CustomerAdapter.GetChangeItems(request.Customer, customer);
            response.CustomerId = bc.StoreCustomer(customer, changeItems);

            return response;
        }
Exemplo n.º 2
0
        public StoreCustomerResponse StoreCustomer(StoreCustomerRequest request)
        {
            StoreCustomerResponse response = new StoreCustomerResponse();
            CustomerBusinessComponent bc = DependencyInjectionHelper.GetCustomerBusinessComponent();

            Customer customer = CustomerAdapter.DtoToCustomer(request.Customer);
            IEnumerable<ChangeItem> changeItems = CustomerAdapter.GetChangeItems(request.Customer, customer);
            response.CustomerId = bc.StoreCustomer(customer, changeItems);

            return response;
        }
 public void TestStoreCustomer()
 {
     CustomerDTO customer = new CustomerDTO();
     customer.Id = 123;
     StoreCustomerResponse response = new StoreCustomerResponse();
     response.CustomerId = customer.Id;
     Expect.Once.On(service).Method("StoreCustomer").Will(Return.Value(response));
     serviceFacade.StoreCustomer(customer);
 }