コード例 #1
0
 protected override void ValidateBeforeInsert(InactiveLeaseDTO lse)
 {
     if (!_db.ActiveLeases.HasId(lse.Id))
     {
         throw Bad.Insert(lse, "Missing from Actives");
     }
 }
コード例 #2
0
 protected override void ValidateBeforeInsert(PassbookRowDTO newRecord)
 {
     if (!IsValidForInsert(newRecord, out string whyNot))
     {
         throw Bad.Insert(newRecord, whyNot);
     }
 }
コード例 #3
0
        public void InsertDepositedColxn(BankDepositDTO deposit, DateTime colxnDate)
        {
            var whyNot = deposit.WhyInvalidForColxnDeposit(BankAccountID);

            if (!whyNot.IsBlank())
            {
                throw Bad.Insert(deposit, whyNot);
            }

            var repo = FindRepo(deposit.DepositDate);
            var row  = deposit.ToPassbookRow(colxnDate);

            repo.Insert(row);
        }
コード例 #4
0
        public void InsertClearedCheque(ChequeVoucherDTO cheque, DateTime clearedDate)
        {
            var whyNot = cheque.WhyInvalidForSetAsCleared(BankAccountID);

            if (!whyNot.IsBlank())
            {
                throw Bad.Insert(cheque, whyNot);
            }

            var repo = FindRepo(clearedDate);
            var row  = cheque.ToPassbookRow(clearedDate);

            repo.Insert(row);
        }