protected virtual async Task UpdateReceiveOrderAsync(CreateOrUpdateReceiveOrderInput input) { Debug.Assert(input.ReceiveOrder.Id != null, "input.ReceiveOrder.Id should be set."); var receiveOrder = input.ReceiveOrder.MapTo<MaterialReceiveOrderInfo>(); receiveOrder.LastModifierUserId = AbpSession.UserId; receiveOrder.LastModifierUserName = GetCurrentUser().RealName; receiveOrder.LastModificationTime = Clock.Now; await _receiveOrderRepository.UpdateAsync(receiveOrder); }
protected virtual async Task CreateReceiveOrderAsync(CreateOrUpdateReceiveOrderInput input) { var receiveOrder = input.ReceiveOrder.MapTo<MaterialReceiveOrderInfo>(); receiveOrder.Id = GuidHelper.NewGuid(); receiveOrder.OrgId = AbpSession.OrgId; receiveOrder.CreatorUserId = AbpSession.UserId; receiveOrder.CreatorUserName = GetCurrentUser().RealName; receiveOrder.CreationTime = Clock.Now; await _receiveOrderRepository.InsertAsync(receiveOrder); }
/// <summary> /// 添加修改实体 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task CreateOrUpdateReceiveOrder(CreateOrUpdateReceiveOrderInput input) { if (input.ReceiveOrder.Id != null && input.ReceiveOrder.Id != Guid.Empty) { await UpdateReceiveOrderAsync(input); } else { await CreateReceiveOrderAsync(input); } }