public Customer(Customer customer, Account account = null, Guid?originStore = null) { if (!account.IsNull()) { if (customer is Person) { customer.Name = string.Format("{0} {1}", ((Entities.Person)customer).FirstName, ((Entities.Person)customer).LastName); } else { customer.Name = ((Entities.Company)customer).CompanyName; } } }
public Person(Person person, Account account = null, Guid?originStore = null) : base(person, account, originStore) { FirstName = person.FirstName; LastName = person.LastName; Cpf = person.Cpf; Rg = person.Rg; BirthDate = person.BirthDate; Gender = person.Gender; if (!account.IsNull()) { person.Cpf = account.Document; } }
public void HandlerToGet() { if (this != null) { if (!Account.IsNull()) { this.Email = Account.Email; this.Password = Account.Password; } this.Addresses = this.AddressData.Deserialize <List <AddressCustomer> >(); if (this is Person) { this.Name = string.Format("{0} {1}", ((Person)this).FirstName, ((Person)this).LastName); } else { this.Name = ((Company)this).CompanyName; } } }