public Customer Update(int id, CustomerFormData formData)
        {
            var customer = Get(id);

            Update(customer.Name, formData.Person);
            Update(customer.Address, formData.Address);
            Update(customer.Phone, formData.Phone);
            return(customer);
        }
Пример #2
0
        private bool Save(CustomerFormData formData)
        {
            var id       = (int)_selectedContact.Value;
            var customer = _customerRepository.Update(id, formData);

            this.UpdateList("Contacts", ToContact(customer));
            _selectedContact.Value = id;
            return(true);
        }
        public Customer Add(CustomerFormData formData)
        {
            var customer = new Customer
            {
                Id      = _mockData.Max(x => x.Id) + 1,
                Name    = new NameInfo(),
                Address = new AddressInfo(),
                Phone   = new PhoneInfo()
            };

            Update(customer.Name, formData.Person);
            Update(customer.Address, formData.Address);
            Update(customer.Phone, formData.Phone);

            _mockData.Add(customer);
            return(customer);
        }
Пример #4
0
 public Customer Save(CustomerFormData formData)
 {
     return(_customerRepository.Add(formData));
 }