public async Task <ActionResultResponse <string> > Insert(string tenantId, ContactCustomerMeta contactCustomerMeta) { var contactCustomer = new CustomerRelativesContact { FullName = contactCustomerMeta.FullName, CustomerId = contactCustomerMeta.CustomerId, PhoneNumber = contactCustomerMeta.PhoneNumber }; var resultInsert = await _contactCustomerRepository.Insert(contactCustomer); if (resultInsert > 0) { return(new ActionResultResponse <string>(resultInsert, _customerResourceService.GetString("Add new contact successful."), string.Empty, contactCustomer.Id)); } await RollbackInsert(contactCustomer.Id); return(new ActionResultResponse <string>(-4, _customerResourceService.GetString("Can not insert new ContactCustomer. Please contact with administrator."))); }
public async Task <int> Update(CustomerRelativesContact contactCustomer) { return(await Context.SaveChangesAsync()); }
public async Task <int> Insert(CustomerRelativesContact contactCustomer) { _contactCustomerRepository.Create(contactCustomer); return(await Context.SaveChangesAsync()); }