private void txtFeeLoan_Leave(object sender, EventArgs e) { if (txtFeeAccount.Text == "") { return; } try { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { sbfa.BusinessRegistration reg = agent.operation.GetOldBusinessRegistrationByRegistration(txtFeeAccount.Text, txtFeeLoan.Text); lblName.Text = reg.FirstNames + " " + reg.LastName; lblNIN.Text = reg.NIN; lblLoc.Text = agent.operation.GetEntityName(reg.FK_ResidenceIslandLocationId, "isl") + "," + agent.operation.GetEntityName(reg.FK_ResidenceDistrictLocationId, "dis"); sbfa.BusinessAccountOld bus = agent.operation.GetOldBusinessAccountByAccount(txtFeeAccount.Text, txtFeeLoan.Text); double bal = bus.Penalty + bus.ProcessingFee + bus.CancellationFee; lblTotal.Text = bal.ToString(); lblDue.Text = bal.ToString(); } } catch { // } }
private void ReceiveOldRepayment_Load(object sender, EventArgs e) { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { Globals.SetPickList(cmbPayMethod, "paymet"); Globals.SetPickList(cmbBranch, "bra"); Globals.SetPickList(cmbCurrency, "cur"); Globals.SetPickList(cmbFeePayMethod, "paymet"); Globals.SetPickList(cmbFeeBranch, "bra"); Globals.SetPickList(cmbFeeCurrency, "cur"); if (SBFAMain.oldAccount != "" && SBFAMain.oldLoan != "") { txtAccount.Text = SBFAMain.oldAccount; txtLoan.Text = SBFAMain.oldLoan; sbfa.BusinessRegistration reg = agent.operation.GetOldBusinessRegistrationByRegistration(txtAccount.Text, txtLoan.Text); lblName.Text = reg.FirstNames + " " + reg.LastName; lblNIN.Text = reg.NIN; lblLoc.Text = agent.operation.GetEntityName(reg.FK_ResidenceIslandLocationId, "isl") + "," + agent.operation.GetEntityName(reg.FK_ResidenceDistrictLocationId, "dis"); sbfa.BusinessAccountOld bus = agent.operation.GetOldBusinessAccountByAccount(txtAccount.Text, txtLoan.Text); double bal = bus.AccountBalance;// CalculateBalance(bus.AccountBalance.ToString(), bus.IntrestRate.ToString(), bus.LastCalculationDate); lblTotal.Text = bal.ToString(); lblDue.Text = bal.ToString(); } } }
private void ProcessInvoice_Load(object sender, EventArgs e) { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { //check documents sbfa.Invoice invoice = agent.operation.GetInvoice(SBFAMain.currentInvoiceId); lblAmount.Text = invoice.Currency + invoice.Amount.ToString(); lbSur.Text = invoice.Currency + invoice.AmountSurcharge.ToString(); lblDisc.Text = invoice.Currency + invoice.AmountDiscount.ToString(); lblTotal.Text = invoice.Currency + invoice.AmountTotal.ToString(); lblPaid.Text = invoice.CurrencyPaid + invoice.AmountPaid.ToString(); lblDue.Text = invoice.Currency + (invoice.AmountTotal - invoice.AmountPaid); lblReference.Text = invoice.FK_ReferenceNumber; lblFor.Text = invoice.DocumentType.ToUpper(); lblReceipt.Text = invoice.ReceiptNumber; due = invoice.AmountTotal - invoice.AmountPaid; cur = invoice.Currency; Globals.SetPickList(cmbPayMethod, "paymet"); Globals.SetPickList(cmbBranch, "bra"); Globals.SetPickList(cmbCurrency, "cur"); if (due <= 0) { btnOpenPay.Visible = false; pnlPay.Visible = false; btnPrint.Visible = true; } else { btnOpenPay.Visible = true; btnPrint.Visible = false; } //get applicant details if registration if (invoice.DocumentType == "loan") { sbfa.LoanRequest reg = agent.operation.GetLoanRequest(invoice.FK_DocumentId); lblName.Text = reg.FirstNames + " " + reg.LastName; lblNIN.Text = reg.NIN; lblLoc.Text = agent.operation.GetEntityName(reg.FK_ResidenceIslandLocationId, "isl") + "," + agent.operation.GetEntityName(reg.FK_ResidenceDistrictLocationId, "dis"); } else if (invoice.DocumentType == "repayment") { sbfa.BusinessRegistration reg = agent.operation.GetBusinessRegistrationByRegistration(invoice.FK_ReferenceNumber.Split('_')[0]); lblName.Text = reg.FirstNames + " " + reg.LastName; lblNIN.Text = reg.NIN; lblLoc.Text = agent.operation.GetEntityName(reg.FK_ResidenceIslandLocationId, "isl") + "," + agent.operation.GetEntityName(reg.FK_ResidenceDistrictLocationId, "dis"); } sbfa.InvoiceItem[] items = agent.operation.GetInvoiceItems(SBFAMain.currentInvoiceId); foreach (sbfa.InvoiceItem item in items) { string[] row = { item.Id.ToString(), item.Description, item.Amount.ToString() }; var listViewItem = new ListViewItem(row); lstItems.Items.Add(listViewItem); } } }
private void txtAccount_Leave(object sender, EventArgs e) { try { SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { sbfa.BusinessRegistration reg = agent.operation.GetBusinessRegistrationByRegistration(txtAccount.Text); lblName.Text = reg.FirstNames + " " + reg.LastName; lblNIN.Text = reg.NIN; lblLoc.Text = agent.operation.GetEntityName(reg.FK_ResidenceIslandLocationId, "isl") + "," + agent.operation.GetEntityName(reg.FK_ResidenceDistrictLocationId, "dis"); sbfa.BusinessAccount bus = agent.operation.GetBusinessAccountByAccount(txtAccount.Text); double bal = CalculateBalance(bus.AccountBalance.ToString(), bus.IntrestRate.ToString(), bus.LastCalculationDate); lblTotal.Text = bal.ToString(); lblDue.Text = bal.ToString(); } } catch { // } }
private void btnPayPenalty_Click(object sender, EventArgs e) { pnlFees.Visible = true; SBFAApi agent = new SBFAApi(); using (new OperationContextScope(agent.context)) { if (SBFAMain.oldAccount != "" && SBFAMain.oldLoan != "") { txtFeeAccount.Text = SBFAMain.oldAccount; txtFeeLoan.Text = SBFAMain.oldLoan; sbfa.BusinessRegistration reg = agent.operation.GetOldBusinessRegistrationByRegistration(txtFeeAccount.Text, txtFeeLoan.Text); lblName.Text = reg.FirstNames + " " + reg.LastName; lblNIN.Text = reg.NIN; lblLoc.Text = agent.operation.GetEntityName(reg.FK_ResidenceIslandLocationId, "isl") + "," + agent.operation.GetEntityName(reg.FK_ResidenceDistrictLocationId, "dis"); sbfa.BusinessAccountOld bus = agent.operation.GetOldBusinessAccountByAccount(txtFeeAccount.Text, txtFeeLoan.Text); double bal = bus.Penalty + bus.ProcessingFee + bus.CancellationFee; lblTotal.Text = bal.ToString(); lblDue.Text = bal.ToString(); } } }