Dynamically updating payment details

G

Guest

I have got a page that shows student payment information. On the page the
user can view total amount paid by student, amount outstanding and the course
fee; add paymnent to the database; and also view individual payment made with
their corresponding date of paymnent, the method of payment and the amount
paid. These are all under three respectivel panel in one page.

What i really want to do is, If a user add payment to the database, i want
the other part of the page to update itself authomatically i.e the payment
added should automatically update viewpayment() and the paymentdetails() sub
where the viewpayment() allow to view total payment and amount outstanding
and paymentdetails allow to view date of payment, amountpaid and method of
payment

I want to know how i can do that. Below is the sub of the page.

Sub Paymentdetails()
Showpaymentpanel.Visible = True
Dim StudentID As Integer = CInt(Request.Params("StudentID"))
Dim Balance As New Payment2DB
ShowPaymentDataList.Datasource =
Balance.Sel_Balance(Request.Params("StudentID"))
ShowPaymentDataList.Databind()
If ShowPaymentDataList.Items.Count = 0 Then
ErrorMsg.Text = "There are no Payments recorded for this student
yet. Use the form below if required."
End If
End Sub

Sub ViewPayment()
viewpaymentpanel.Visible = True
Dim StudentID As Integer = CInt(Request.Params("StudentID"))
Dim Balance As New Payment2DB
viewpaymentdatalist.DataSource =
Balance.Sel_Payment(Request.Params("StudentID"))
viewpaymentdatalist.DataBind()
If Viewpaymentdatalist.Rows.Count = 0 Then
ErrorMsg.Text = "There are no Payments recorded for this student
yet. Use the form below if required."
End If
End Sub

Sub AddPayment_Click(ByVal Sender As Object, ByVal e As EventArgs)
If Page.IsValid = True Then
Dim StudentID As Integer = CInt(ViewState("StudentID"))
Dim Addpayment As New Payment2DB
Addpayment.AddPayment(StudentID,
Server.HtmlEncode(DateOfPayment.Text), Server.HtmlEncode(amountpaid.Text),
Server.HtmlEncode(MethodofPayment.SelectedValue))
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,132
Latest member
TeresaWcq1
Top