protected virtual async Task UpdatePurchasePlanAsync(CreateOrUpdatePurchasePlanInput input) { Debug.Assert(input.PurchasePlan.Id != null, "input.PurchasePlan.Id should be set."); var purchasePlan = input.PurchasePlan.MapTo<PlanPurchasePlanInfo>(); purchasePlan.LastModifierUserId = AbpSession.UserId; purchasePlan.LastModifierUserName = GetCurrentUser().RealName; purchasePlan.LastModificationTime = Clock.Now; await _purchasePlanRepository.UpdateAsync(purchasePlan); }
protected virtual async Task CreatePurchasePlanAsync(CreateOrUpdatePurchasePlanInput input) { var purchasePlan = input.PurchasePlan.MapTo<PlanPurchasePlanInfo>(); purchasePlan.Id = GuidHelper.NewGuid(); purchasePlan.OrgId = AbpSession.OrgId; purchasePlan.CreatorUserId = AbpSession.UserId; purchasePlan.CreatorUserName = GetCurrentUser().RealName; purchasePlan.CreationTime = Clock.Now; await _purchasePlanRepository.InsertAsync(purchasePlan); }
/// <summary> /// 添加修改实体 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task CreateOrUpdatePurchasePlan(CreateOrUpdatePurchasePlanInput input) { if (input.PurchasePlan.Id != null && input.PurchasePlan.Id != Guid.Empty) { await UpdatePurchasePlanAsync(input); } else { await CreatePurchasePlanAsync(input); } }