Example #1
0
 public Bill(string billID, string description, decimal amount, DateTime issueDate, DateTime dueDate, PaymentMethod paymentMethod)
 {
     this.billID = billID;
     this.description = description;
     this.amount = amount;
     this.issueDate = issueDate;
     this.dueDate = dueDate.Date;
     this.paymentResult = (int)BillPaymentResult.ToCollect;
     this.assignedPaymentMethod = paymentMethod;
     this.paymentAgreements = new Dictionary<DateTime, PaymentAgreement>();
 }
Example #2
0
 private void SetBillAsUnpaid()
 {
     paymentResult = BillPaymentResult.Unpaid;
     CancellAnyAgreementsActiveForBill();
 }
Example #3
0
 private void SetBillAsToCollect()
 {
     paymentResult = BillPaymentResult.ToCollect;
 }
Example #4
0
 public void RenegotiateBill(PaymentAgreement renegotiationAgreement)
 {
     paymentResult = BillPaymentResult.Renegotiated;
     this.renegotiationAgreement = renegotiationAgreement;
 }
Example #5
0
 public void PayBill(Payment payment)
 {
     if (this.amount != payment.PaymentAmount)
         throw new System.ArgumentException("Only payments for the bill total amount are accepted", "payment");
     this.payment = payment;
     paymentResult = BillPaymentResult.Paid;
 }
Example #6
0
 public void CancelBill()
 {
     paymentResult = BillPaymentResult.CancelledOut;
 }