public void SaveCustomer(CustomerDto customerDto)
        {
            SIRepository repository = new SIRepository();
            repository.GetObject((x) => { return new Customer(); });
            SIAccountServices accountServices = new SIAccountServices();
            IDtoCreator<Customer, CustomerDto> custCreator = new CustomerDtoCreator();

            SICustomerRepository customerRepository = new SICustomerRepository();
            CustomerServices services = new CustomerServices(customerRepository, repository, accountServices, custCreator);
            services.SaveCustomer(customerDto);
        }
Example #2
0
 public void Update(ref Customer customer, CustomerDto customerDto)
 {
     customer.Email = customerDto.Email;
     customer.FirstName = customerDto.FirstName;
     customer.LastName = customerDto.LastName;
     customer.PhoneNumber = customerDto.PhoneNumber;
     customer.Situation = customerDto.Situation;
 }
Example #3
0
 public void SaveCustomer(CustomerDto customer)
 {
     Contract.Requires<CustomerServicesException>(customer != null);
     Contract.Requires<CustomerServicesException>(customer.Email != null);
 }
Example #4
0
        public void SaveCustomer(CustomerDto customerDto)
        {
            Customer customer = _repository.Load<Customer>(customerDto.Id);

            if (customer == null)
            {
                throw new CustomerServicesException(String.Format("Could not find customer in the DB: {0}", customerDto.Id));
            }

            Update(ref customer, customerDto);

            using (TransactionScope scope = new TransactionScope())
            {
                _repository.Update<Customer>(customer);
                _repository.Flush();
                scope.Complete();
            }
        }
 public void SaveCustomerDto(CustomerDto customerDto)
 {
     CustomerServices.SaveCustomer(customerDto);
 }