예제 #1
0
        /// <summary>
        /// User has clicked the PMT compute Button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mBtnPMTCompute_Click(object sender, EventArgs e)
        {
            TvmObject O = new TvmObject();
            double    Pmt;
            bool      Valid = true;

            #region Verify Format
            if ((double.TryParse(mN.Text, out double w)) == false)
            {
                mN.Hint = "Invalid Input";
                Valid   = false;
            }
            if ((double.TryParse(mIY.Text, out double x)) == false)
            {
                mIY.Hint = "Invalid Input";
                Valid    = false;
            }
            if ((double.TryParse(mPV.Text, out double y)) == false)
            {
                mPV.Hint = "Invalid Input";
                Valid    = false;
            }
            if ((double.TryParse(mFV.Text, out double z)) == false)
            {
                mFV.Hint = "Invalid Input";
                Valid    = false;
            }
            #endregion

            if (Valid == true)
            {
                O.N  = double.Parse(mN.Text);
                O.I  = double.Parse(mIY.Text);
                O.Pv = double.Parse(mPV.Text);
                O.Fv = double.Parse(mFV.Text);
                Pmt  = PmtCompute(O);

                mPMT.Text = Pmt.ToString();
            }
        }
예제 #2
0
    protected void chkLateFEE_CheckedChanged(object sender, EventArgs e)
    {
        if (chkLateFEE.Checked == true)
        {
            T = Convert.ToInt32(lblGAmt.Text);
            L = Convert.ToInt32(lblTLate.Text);
            R = Convert.ToInt32(lblReqAmt.Text);
            if (R <= T)
            {
                lblMessage1.Text = "Late Fee Not Required";
                lblLTaken.Text   = "0";
                lblLRem.Text     = lblTLate.Text.ToString();

                lblTotalAmtPay.Text = lblReqAmt.Text.ToString();
                btnApprove.Visible  = true;
            }
            else
            {
                Df = R - T;
                if (Df > L)
                {
                    Mr             = Df - L;
                    lblLTaken.Text = L.ToString();
                    L    = L - (Df - Mr);
                    Ltkn = Df - Mr;

                    lblLRem.Text        = "0";
                    Pmt                 = T + Ltkn;
                    lblMessage1.Text    = "Late fee is less, More Required: " + Mr.ToString() + " Rs. for all form approval, and Now Total Amt: We have " + Pmt.ToString();
                    lblTotalAmtPay.Text = Pmt.ToString();
                    btnApprove.Visible  = true;
                }
                else if (Df <= L)
                {
                    Tkn                 = L - Df;
                    L                   = L - Df;
                    lblLTaken.Text      = Df.ToString();
                    lblLRem.Text        = L.ToString();
                    Pmt                 = T + Df;
                    Udr                 = Df;
                    lblMessage1.Text    = "update late fee as: " + L.ToString() + " Rs. ";
                    btnApprove.Visible  = true;
                    lblTotalAmtPay.Text = Pmt.ToString();
                }
            }
        }
        else if (chkLateFEE.Checked == false)
        {
            T = Convert.ToInt32(lblGAmt.Text);
            L = 0;
            R = Convert.ToInt32(lblReqAmt.Text);
            lblLTaken.Text = L.ToString();
            lblLRem.Text   = lblTLate.Text.ToString();
            if (R <= T)
            {
                lblMessage1.Text       = "Amount enough 4 Admission form.";
                lblTotalAmtPay.Text    = lblReqAmt.Text.ToString();
                lblToBeApprovadNo.Text = lblTFromNo.Text.ToString();
                lblToBeAmount.Text     = lblReqAmt.Text.ToString();
                btnApprove.Visible     = true;
            }
            else
            {
                Df = R - T;
                if (Df > L)
                {
                    Mr = Df - L;

                    L                   = L - (Df - Mr);
                    Ltkn                = Df - Mr;
                    Pmt                 = T + Ltkn;
                    lblMessage1.Text    = "Late fee is less, More Required: " + Mr.ToString() + " Rs. for all form approval, and Now Total Amt: We have " + Pmt.ToString();
                    lblTotalAmtPay.Text = T.ToString();

                    btnApprove.Visible = true;
                }
                else if (Df <= L)
                {
                    Tkn = L - Df;
                    L   = L - Df;

                    Pmt = T + Df;
                    Udr = Df;
                    lblMessage1.Text    = "update late fee as: " + L.ToString() + " Rs. ";
                    btnApprove.Visible  = true;
                    lblTotalAmtPay.Text = Pmt.ToString();
                }
            }
        }
    }