private void UpdateCustomer(SimpleEditableCustomer source, Customer target) { target.FirstName = source.FirstName; target.LastName = source.LastName; target.Phone = source.Phone; target.Email = source.Email; target.Address = source.Address; }
private void CopyCustomer(Customer source, SimpleEditableCustomer target) { target.Id = source.Id; if (EditMode) { target.FirstName = source.FirstName; target.LastName = source.LastName; target.Phone = source.Phone; target.Email = source.Email; target.Address = source.Address; } }
public void SetCustomer(Customer cust) { try { _editingCustomer = cust; if (Customer != null) { Customer.ErrorsChanged -= RaiseCanExecuteChanged; } Customer = new SimpleEditableCustomer(); Customer.ErrorsChanged += RaiseCanExecuteChanged; CopyCustomer(cust, Customer); } catch (Exception e) { Logger.Error(e); } }