protected virtual async Task <Customer> UpdateCustomerAsync(CreateOrUpdateCustomerInput input) { var logistics = await _customerManager.FindByIdAsync(input.Id); ObjectMapper.Map(input, logistics); await _customerManager.UpdateAsync(logistics); return(logistics); }
public async Task CreateOrUpdateCustomer(CreateOrUpdateCustomerInput input) { if (!input.Customer.Id.HasValue) { await this._customerRepository.InsertAsync(input.Customer.MapTo <Customer>()); } else { await this._customerRepository.UpdateAsync(input.Customer.MapTo <Customer>()); } }
public void CreateOrUpdateCustomer(CreateOrUpdateCustomerInput input) { if (input.Customer.Id.HasValue) { UpdateCustomer(input); } else { CreateCustomer(input); } }
/// <summary> /// 新增或更改客户信息 /// </summary> public async Task CreateOrUpdateCustomerAsync(CreateOrUpdateCustomerInput input) { if (input.CustomerEditDto.Id.HasValue) { await UpdateCustomerAsync(input.CustomerEditDto); } else { await CreateCustomerAsync(input.CustomerEditDto); } }
public async Task CreateOrUpdateCustomerAsync(CreateOrUpdateCustomerInput input) { if (input.customerEditDto.Id.HasValue) { await UpdateCustomerAsync(input.customerEditDto); } else { await CreateCustomerAsync(input.customerEditDto); } // throw new NotImplementedException(); }
protected virtual async Task <Customer> CreateCustomerAsync(CreateOrUpdateCustomerInput input) { var customer = new Customer() { Name = input.Name, PhoneNumber = input.PhoneNumber, AvatarPictureId = input.AvatarPictureId, TotalConsumes = input.TotalConsumes, TotalOrderNum = input.TotalOrderNum, }; await _customerManager.CreateAsync(customer); return(customer); }
/// <summary> /// 创建或更新客户 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <EntityDto <long> > CreateOrUpdateCustomer(CreateOrUpdateCustomerInput input) { Customer customer; if (input.Id > 0) { customer = await UpdateCustomerAsync(input); } else { customer = await CreateCustomerAsync(input); } await CurrentUnitOfWork.SaveChangesAsync(); return(new EntityDto <long> { Id = customer.Id }); }
protected void UpdateCustomer(CreateOrUpdateCustomerInput input) { var entity = _customerRespository.Get(input.Customer.Id.Value); entity.Name = input.Customer.Name; entity.Area = input.Customer.Area; entity.Age = input.Customer.Age; entity.IdCard = input.Customer.IdCard; entity.Interest = input.Customer.Interest; entity.DebitAmount = input.Customer.DebitAmount; entity.SesameScore = input.Customer.SesameScore; entity.CreditRating = input.Customer.CreditRating; entity.ApplicationDate = input.Customer.ApplicationDate; entity.Tel = input.Customer.Tel; entity.WeChat = input.Customer.WeChat; entity.QQ = input.Customer.QQ; entity.AppEquipment = input.Customer.AppEquipment; entity.Source = input.Customer.Source; entity.IsComplete = input.Customer.IsComplete; entity.RecordCharge = input.Customer.RecordCharge; }
protected void CreateCustomer(CreateOrUpdateCustomerInput input) { var entity = input.Customer.MapTo <CustomerInfo>(); _customerRespository.Insert(entity); }