|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Dynamically updating payment detailsuser 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 |
|||||||||||||||||||||||