protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { LoanDSTableAdapters.PaymentVoucherTableAdapter paymentvoucher = new LoanDSTableAdapters.PaymentVoucherTableAdapter(); if (!(type == "update")) { paymentvoucher.InsertPaymentVoucher(MySessionManager.ClientID, MySessionManager.AppID, txtDescription.Value.Trim(), txtReference.Value.Trim(), Convert.ToDecimal(txtAmount.Value.Trim()), Convert.ToInt32(ddlPaymetMode.SelectedValue), MySessionManager.CurrentUser.UserID); } else if (type == "update") { paymentvoucher.UpdatePaymentVoucher(txtDescription.Value.Trim(), txtReference.Value.Trim(), Convert.ToDecimal(txtAmount.Value.Trim()), Convert.ToInt32(ddlPaymetMode.SelectedValue), MySessionManager.CurrentUser.UserID, id); } Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "pvedit")); txtTotalAmount.Text = sumAmount().ToString(); txtAmtWords.Value = NTE.changeCurrencyToWords(Convert.ToDouble(sumAmount())); } }
public decimal sumAmount() { decimal sum = 0; LoanDSTableAdapters.PaymentVoucherTableAdapter pv = new LoanDSTableAdapters.PaymentVoucherTableAdapter(); sum = Convert.ToDecimal(pv.GetTotalAmount(MySessionManager.ClientID, MySessionManager.AppID)); return(sum); }
public void loadpv(int id) { LoanDSTableAdapters.PaymentVoucherTableAdapter pv = new LoanDSTableAdapters.PaymentVoucherTableAdapter(); LoanDS.PaymentVoucherDataTable tblpv = pv.GetPaymentVoucherDetail(id); if (tblpv.Rows.Count > 0) { txtAmount.Value = tblpv[0].datAmount.ToString(); txtReference.Value = tblpv[0].datReference.ToString(); txtDescription.Value = tblpv[0].datDescription.ToString(); // ddlPaymetMode.Items.IndexOf(ddlPaymetMode.Items.FindByValue(tblpv[0].datFeePaymentID.ToString())); this.editskip.Value = "2"; } }
public decimal sumAmount() { decimal sum = 0; LoanDSTableAdapters.PaymentVoucherTableAdapter pv = new LoanDSTableAdapters.PaymentVoucherTableAdapter(); sum = Convert.ToDecimal(pv.GetTotalAmount(MySessionManager.ClientID, MySessionManager.AppID)); return sum; }