protected virtual async Task UpdateYearPlanAsync(CreateOrUpdateYearPlanInput input) { Debug.Assert(input.YearPlan.Id != null, "input.YearPlan.Id should be set."); var yearPlan = input.YearPlan.MapTo<PlanYearPlanInfo>(); yearPlan.LastModifierUserId = AbpSession.UserId; yearPlan.LastModifierUserName = GetCurrentUser().RealName; yearPlan.LastModificationTime = Clock.Now; await _yearPlanRepository.UpdateAsync(yearPlan); }
protected virtual async Task CreateYearPlanAsync(CreateOrUpdateYearPlanInput input) { var yearPlan = input.YearPlan.MapTo<PlanYearPlanInfo>(); yearPlan.Id = GuidHelper.NewGuid(); yearPlan.OrgId = AbpSession.OrgId; yearPlan.CreatorUserId = AbpSession.UserId; yearPlan.CreatorUserName = GetCurrentUser().RealName; yearPlan.CreationTime = Clock.Now; await _yearPlanRepository.InsertAsync(yearPlan); }
/// <summary> /// 添加修改实体 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task CreateOrUpdateYearPlan(CreateOrUpdateYearPlanInput input) { if (input.YearPlan.Id != null && input.YearPlan.Id != Guid.Empty) { await UpdateYearPlanAsync(input); } else { await CreateYearPlanAsync(input); } }