public Result <PayInfoDto> GetPayInfo(GetPayInfoDto payInfoDto) { var personId = payInfoDto.IdPerson; //todo: set the static constanct string creditChannel = string.IsNullOrWhiteSpace(payInfoDto.Channel) ? "Constant" : payInfoDto.Channel.ToUpper(); var autoCheckoffQuery = _checkoffAutoAcpRepository.GetAll().Where(a => a.IdPerson == personId && (a.PayStatus == "u" || (a.PayStatus == "k" && a.CommandType == 3))); var isWithholding = _checkoffCommandRepository.GetAll().Any(a => a.ProType == "c") || autoCheckoffQuery.Any(a => a.ProType == "c"); //todo: return the correct result var dto = new PayInfoDto(); return(Result.FromData(dto)); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> public Result <CheckoffAutoAcpDto> UpdateCheckoffAutoAcp(int id) { var entity = _checkoffAutoAcpRepository.GetAll().FirstOrDefault(m => m.Id == id); if (null == entity) { return(Result.FromError <CheckoffAutoAcpDto>("没有该记录")); } entity.SendTime = DateTime.Now; var dto = entity.MapTo <CheckoffAutoAcpDto>(); return(Result.FromData(dto)); }
public Result LendBook(int readId, string bookId, string comment) { var reader = _readerRepository.GetAll().FirstOrDefault(m => m.Id == readId); //todo: 先判断该用户是否还能借书或者是否有其他业务限制 var book = _bookRepository.GetAll().FirstOrDefault(m => m.Id == bookId); if (null == book) { return(Result.FromError("该书不存在")); } return(book.Lend(readId, comment)); //和系统打交道,告知系统该书已经借出? }