Example #1
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     Invoice invoice = BLInvoice.GetInvoiceListById(APCContext,int.Parse(tbInvoiceId.Text));
     BLPaymentFromClient.insertPaymentFromClient(APCContext,invoice,decimal.Parse(tbPaymentAmount.Text), calPaidDate.Value);
     
     //check if payment has been made full - if yes then can mark as paid.
     if (invoice.TotalDue <= TotalPaid(invoice.Id))
     {
         invoice.Paid = true;
         invoice.DatePaid = DateTime.Now;
         APCContext.SaveChanges();
     }
     
     MessageBox.Show("Payment has been recorded");
 }