public async Task <bool> Update(Customer customer) { // return success await Task.Delay(500); return(true); }
public static Customer Clone(Customer customer) { return(new Customer() { AddressLine1 = customer.AddressLine1, Category = Clone(customer.Category), Country = Clone(customer.Country), DateOfBirth = customer.DateOfBirth, Gender = Clone(customer.Gender), HouseNumber = customer.HouseNumber, Id = customer.Id, Name = customer.Name, State = customer.State }); }
private void SetupForInsertOrEdit(SessionState sessionState) { object item; if (sessionState.TryGetValue(StateKeys.CustomerForEdit, out item)) { originalCustomer = Factory.Clone((Customer)item); Customer = (Customer)item; } else { // init default new Customer Customer = new Customer { Category = Categories[0], Country = Countries[0], Gender = Genders[2] }; } }
public async Task <bool> Update(Customer model) { var dto = Factory.CreateFrom(model); return(await this.Put(string.Format("customers/{0}", dto.Id), dto)); }
public async Task <bool> Insert(Customer model) { var dto = Factory.CreateFrom(model); return(await this.Post("customers", dto)); }