/// <summary> /// 编辑培训班人员信息表 /// </summary> // [AbpAuthorize(T_HClassAppPermissions.T_HClass_EditT_HClass)] public virtual async Task UpdateT_HClassAsync(T_HClassEditDto input) { //TODO:更新前的逻辑判断,是否允许更新 var entity = await _t_HClassRepository.GetAsync(input.Id.Value); input.MapTo(entity); await _t_HClassRepository.UpdateAsync(entity); }
/// <summary> /// 新增培训班人员信息表 /// </summary> //[AbpAuthorize(T_HClassAppPermissions.T_HClass_CreateT_HClass)] public virtual async Task <T_HClassEditDto> CreateT_HClassAsync(T_HClassEditDto input) { //TODO:新增前的逻辑判断,是否允许新增 var entity = input.MapTo <T_HClass>(); entity.FK_HClass_ClassId = input.FK_ClassId; entity.FK_HClass_UserId = input.FK_UserId; entity = await _t_HClassRepository.InsertAsync(entity); return(entity.MapTo <T_HClassEditDto>()); }
/// <summary> /// 通过Id获取培训班人员信息表信息进行编辑或修改 /// </summary> public async Task <GetT_HClassForEditOutput> GetT_HClassForEditAsync(NullableIdDto <int> input) { var output = new GetT_HClassForEditOutput(); T_HClassEditDto t_HClassEditDto; if (input.Id.HasValue) { var entity = await _t_HClassRepository.GetAsync(input.Id.Value); t_HClassEditDto = entity.MapTo <T_HClassEditDto>(); } else { t_HClassEditDto = new T_HClassEditDto(); } output.T_HClass = t_HClassEditDto; return(output); }