protected override void ValidateBeforeInsert(InactiveLeaseDTO lse) { if (!_db.ActiveLeases.HasId(lse.Id)) { throw Bad.Insert(lse, "Missing from Actives"); } }
protected override void ValidateBeforeInsert(PassbookRowDTO newRecord) { if (!IsValidForInsert(newRecord, out string whyNot)) { throw Bad.Insert(newRecord, whyNot); } }
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); }
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); }