private void btnsave_Click(object sender, EventArgs e)
        {
            Loan l = new Loan();
            l.empid = Global.CURRENT_USER.empid;
            l.principal = Convert.ToDecimal(txtprincipal.Text);
            l.interest = Convert.ToDecimal(txtinterest.Text);
            l.amortization_on_interest = Convert.ToDecimal(txtinterest_amort.Text);
            l.amortization_on_principal = Convert.ToDecimal(txtprincipal_amort.Text);
            l.loantype = LOAN_TYPE;
            l.amortization_period = (Int32)nmamortperiod.Value;
            l.filingdate = dtfilingdate.Value;

            if (l.save())
            {
                MessageBox.Show("Successful");
            }
            else
            {
                MessageBox.Show("There was a problem saving leave :\n" + db.err.Message);
            }
        }
Exemple #2
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            Loan nl = new Loan();
            nl.application_no = lblapplicationno.Text;
            //its okey EMPID and MEMID are treated same way in database.
            nl.empid = applicant.empid;
            nl.comakerid = comaker.empid;
            nl.principal = Convert.ToDecimal(cboprincipal.Text);
            nl.interest = Convert.ToDecimal(txtinterest.Text);
            nl.amortization_period = (int)SELECTED_AMORTIZATION;
            nl.amortization_on_principal = Convert.ToDecimal(txtprincipal_amort.Text);
            nl.amortization_on_interest = Convert.ToDecimal(txtinterest_amort.Text);
            nl.loantype = "SALARY";
            nl.payment_period = cbopayment_mode.Text;
            nl.collection_day = cbocollection_day.Text;
            nl.auto_credit_to_cbu = 0;
            nl.net_proceeds = Convert.ToDecimal(txtnetproceeds.Text);
            nl.prev_loan_application_no = (PREV_LOAN != null) ? PREV_LOAN.application_no : "";

            if (nl.save())
            {
                l.INCREASE_SALARY_LOAN_COUNTER();
                MessageBox.Show("Successful");
                btncancel.PerformClick();
            }
            else
            {
                MessageBox.Show("There was a problem saving your SALARY_LOAN_APPLICATION :");
            }
        }