コード例 #1
0
        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
            {
                //
            }
        }
コード例 #2
0
        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();
                }
            }
        }
コード例 #3
0
        private void btnPay_Click(object sender, EventArgs e)
        {
            if (txtPayAmount.Text.Equals(""))
            {
                ShowValidationError("Please enter the amount to be paid.");
                return;
            }
            if (isNumeric(txtPayAmount.Text) == false)
            {
                ShowValidationError("Please enter a valid amount to be paid.");
                txtFeePayAmount.Focus();
                return;
            }

            SBFAApi agent = new SBFAApi();

            using (new OperationContextScope(agent.context))
            {
                sbfa.BusinessAccountOld bus = agent.operation.GetOldBusinessAccountByAccount(txtAccount.Text, txtLoan.Text);
                // DateTime lDt = GetLastCalculationDate(bus.LastCalculationDate);
                DateTime lDt = DateTime.Parse(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString().PadLeft(2, '0') + "-01 06:00:00.000");
                string   rec = agent.operation.OldReceiptRepayment(bus.AccountNumber, bus.LoanNumber, cmbCurrency.Text, float.Parse(lblDue.Text), float.Parse(txtPayAmount.Text), Globals.GetComboBoxValue(cmbBranch), Globals.GetComboBoxValue(cmbPayMethod), lDt);
                if (rec != "0")
                {
                    lblReceipt.Text  = rec;
                    btnPrint.Visible = true;
                }

                if (rec != "0")
                {
                    lblReceipt.Text  = rec;
                    btnPrint.Visible = false;

                    ShowSuccessMessage("Payment successful. The receipt number for this payment is " + lblReceipt.Text);

                    if (chkPrint.Checked == true)
                    {
                        try
                        {
                            printReceipt(rec);
                        }
                        catch (Exception ex)
                        {
                            ShowError("An error occured in printing. Please install a PDF Reader and try again.");
                        }
                    }
                }
                else
                {
                    ShowErrorMessage("An error occured making the payment!");
                }
            }
        }
コード例 #4
0
        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();
                }
            }
        }