Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        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());
        }