public async Task CreateOrUpdateSupplier(CreateOrUpdateSupplierInput input) { if (!input.Supplier.Id.HasValue) { await this._supplierRepository.InsertAsync(input.Supplier.MapTo <Supplier>()); } else { await this._supplierRepository.UpdateAsync(input.Supplier.MapTo <Supplier>()); } }
public async Task CreateOrUpdateSupplier(CreateOrUpdateSupplierInput input) { if (input.Supplier.Id.HasValue) { await UpdateSupplier(input); } else { await CreateSupplier(input); } }
public async Task CreateOrUpdateSupplierAsync(CreateOrUpdateSupplierInput input) { if (input.supplierEditDto.Id.HasValue) { await UpdateSupplierAsync(input.supplierEditDto); } else { await CreateSupplierAsync(input.supplierEditDto); } //throw new NotImplementedException(); }
public async Task CreateOrUpdateSupplierAsync(CreateOrUpdateSupplierInput input) { if (input.SupplierEditDto.Id.HasValue) { //update await UpdateSupplierAsync(input.SupplierEditDto); } else { //insert await CreateSupplierAsync(input.SupplierEditDto); } }
protected virtual async Task UpdateSupplier(CreateOrUpdateSupplierInput input) { var item = await _supplierRepo.GetAsync(input.Supplier.Id.Value); var dto = input.Supplier; item.SupplierName = dto.SupplierName; item.Address1 = dto.Address1; item.Address2 = dto.Address2; item.Address3 = dto.Address3; item.City = dto.City; item.State = dto.State; item.Country = dto.Country; item.ZipCode = dto.ZipCode; item.PhoneNumber1 = dto.PhoneNumber1; item.Email = dto.Email; item.FaxNumber = dto.FaxNumber; item.Website = dto.Website; item.DefaultCreditDays = dto.DefaultCreditDays; item.OrderPlacedThrough = dto.OrderPlacedThrough; item.TaxRegistrationNumber = dto.TaxRegistrationNumber; CheckErrors(await _supplierManager.CreateSync(item)); }
protected virtual async Task CreateSupplier(CreateOrUpdateSupplierInput input) { var dto = input.Supplier.MapTo <Supplier>(); CheckErrors(await _supplierManager.CreateSync(dto)); }