/// <summary> /// 新增WithDrawa /// </summary> protected virtual async Task <WithDrawaEditDto> CreateWithDrawaAsync(WithDrawaEditDto input) { //TODO:新增前的逻辑判断,是否允许新增 var entity = ObjectMapper.Map <WithDrawa>(input); entity = await _withdrawaRepository.InsertAsync(entity); return(entity.MapTo <WithDrawaEditDto>()); }
/// <summary> /// 编辑WithDrawa /// </summary> protected virtual async Task UpdateWithDrawaAsync(WithDrawaEditDto input) { //TODO:更新前的逻辑判断,是否允许更新 var entity = await _withdrawaRepository.GetAsync(input.Id.Value); input.MapTo(entity); // ObjectMapper.Map(input, entity); await _withdrawaRepository.UpdateAsync(entity); }
/// <summary> /// 导出WithDrawa为excel表 /// </summary> /// <returns></returns> //public async Task<FileDto> GetWithDrawasToExcel(){ //var users = await UserManager.Users.ToListAsync(); //var userListDtos = ObjectMapper.Map<List<UserListDto>>(users); //await FillRoleNames(userListDtos); //return _userListExcelExporter.ExportToFile(userListDtos); //} /// <summary> /// MPA版本才会用到的方法 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <GetWithDrawaForEditOutput> GetWithDrawaForEdit(NullableIdDto <Guid> input) { var output = new GetWithDrawaForEditOutput(); WithDrawaEditDto withdrawaEditDto; if (input.Id.HasValue) { var entity = await _withdrawaRepository.GetAsync(input.Id.Value); withdrawaEditDto = entity.MapTo <WithDrawaEditDto>(); //withdrawaEditDto = ObjectMapper.Map<List <withdrawaEditDto>>(entity); } else { withdrawaEditDto = new WithDrawaEditDto(); } output.WithDrawa = withdrawaEditDto; return(output); }