public void SetAs_Prepared(FundRequestDTO request, DateTime chequeDate, int chequeNumber) { PreparedCheques.Insert(new ChequeVoucherDTO { Request = request, ChequeDate = chequeDate, ChequeNumber = chequeNumber, }); InactiveRequests.Insert(ToInactive(request)); ActiveRequests.Delete(request); }
private FundRequestDTO FindInactiveRequest(ChequeVoucherDTO chq) { var matches = InactiveRequests.Find(_ => _.SerialNum == chq.Request.SerialNum); if (!matches.Any()) { //throw No.Match<FundRequestDTO>("SerialNum", chq.Request.SerialNum); InactiveRequests.Insert(chq.Request); return(FindInactiveRequest(chq)); } if (matches.Count() > 1) { throw DuplicateRecordsException.For(matches, "SerialNum", chq.Request.SerialNum); } return(matches.Single()); }