/// <summary> /// 新增培训重点 /// </summary> // [AbpAuthorize(T_KPointAppPermissions.T_KPoint_CreateT_KPoint)] public virtual async Task <T_KPointEditDto> CreateT_KPointAsync(T_KPointEditDto input) { //TODO:新增前的逻辑判断,是否允许新增 var entity = input.MapTo <T_KPoint>(); entity = await _t_KPointRepository.InsertAsync(entity); return(entity.MapTo <T_KPointEditDto>()); }
/// <summary> /// 编辑培训重点 /// </summary> // [AbpAuthorize(T_KPointAppPermissions.T_KPoint_EditT_KPoint)] public virtual async Task UpdateT_KPointAsync(T_KPointEditDto input) { //TODO:更新前的逻辑判断,是否允许更新 var entity = await _t_KPointRepository.GetAsync(input.Id.Value); input.MapTo(entity); await _t_KPointRepository.UpdateAsync(entity); }
/// <summary> /// 通过Id获取培训重点信息进行编辑或修改 /// </summary> public async Task <GetT_KPointForEditOutput> GetT_KPointForEditAsync(NullableIdDto <int> input) { var output = new GetT_KPointForEditOutput(); T_KPointEditDto t_KPointEditDto; if (input.Id.HasValue) { var entity = await _t_KPointRepository.GetAsync(input.Id.Value); t_KPointEditDto = entity.MapTo <T_KPointEditDto>(); } else { t_KPointEditDto = new T_KPointEditDto(); } output.T_KPoint = t_KPointEditDto; return(output); }