Ejemplo n.º 1
0
 private void txtChangeLoanAmount_Leave(object sender, EventArgs e)
 {
     if (!FieldValidator.isBlank(txtChangeLoanAmount.Text) && CheckForNumber.isNumeric(txtChangeLoanAmount.Text))
     {
         txtChangeLoanAmount.Text = CheckForNumber.formatCurrency2(txtChangeLoanAmount.Text);
     }
 }
Ejemplo n.º 2
0
 private void txtTotalRepayment_Leave(object sender, EventArgs e)
 {
     if (!FieldValidator.isBlank(txtTotalRepayment.Text))
     {
         txtTotalRepayment.Text = CheckForNumber.formatCurrency2(txtTotalRepayment.Text);
     }
     else
     {
         MessageBox.Show("Total Repayment Amount cannot be left blank.", "Loans", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Ejemplo n.º 3
0
        private void txtAmountPaid_Leave(object sender, EventArgs e)
        {
            if (!FieldValidator.isBlank(txtAmountPaid.Text) && CheckForNumber.isNumeric(txtAmountPaid.Text))
            {
                decimal totalAmountRepayment = Convert.ToDecimal(txtTotalRepayment.Text);
                decimal amountPaid           = Convert.ToDecimal(txtAmountPaid.Text);
                decimal outstandingAmount;

                if (amountPaid > totalAmountRepayment)
                {
                    MessageBox.Show("Sorry, that Amount Paid exceeds the Total Repayment Amount.", "Loans", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtAmountPaid.Text = string.Empty;
                }
                else
                {
                    txtAmountPaid.Text     = CheckForNumber.formatCurrency2(txtAmountPaid.Text);
                    outstandingAmount      = totalAmountRepayment - amountPaid;
                    txtOutstandingAmt.Text = CheckForNumber.formatCurrency2(outstandingAmount.ToString());

                    //check outstanding amount and set paymentStatus
                    if (outstandingAmount == 0)
                    {
                        paymentStatus       = "PAID";
                        paymentFinished     = "Yes";
                        dateFinishedPayment = dtPickerPaymentFinished.Value.ToString();

                        lblPaymentFinishedDate.Visible  = true;
                        dtPickerPaymentFinished.Visible = true;
                    }
                    else
                    {
                        paymentStatus       = "Paying";
                        paymentFinished     = "No";
                        dateFinishedPayment = string.Empty;

                        lblPaymentFinishedDate.Visible  = false;
                        dtPickerPaymentFinished.Visible = false;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private bool passValidation()
        {
            bool   validationPassed = true;
            string strMessage       = null;

            if (txtTitle.Text == string.Empty)
            {
                strMessage        += "Title is required";
                validationPassed   = false;
                txtTitle.BackColor = System.Drawing.Color.Yellow;
            }
            else
            {
                txtTitle.BackColor = Color.Empty;
            }



            if (FieldValidator.isBlank(txtFirstName.Text))
            {
                strMessage            += "\nFirst Name is required";
                validationPassed       = false;
                txtFirstName.BackColor = Color.Yellow;
            }
            else
            {
                txtFirstName.BackColor = Color.Empty;
            }


            if (txtLastName.Text == string.Empty)
            {
                strMessage           += "\nLast Name is required";
                validationPassed      = false;
                txtLastName.BackColor = Color.Yellow;
            }
            else
            {
                txtLastName.BackColor = Color.Empty;
            }


            if (!radMale.Checked && !radFemale.Checked)
            {
                strMessage         += "\nGender is required";
                validationPassed    = false;
                radMale.BackColor   = Color.Yellow;
                radFemale.BackColor = Color.Yellow;
            }
            else
            {
                radMale.BackColor   = Color.Empty;
                radFemale.BackColor = Color.Empty;
            }



            if (txtPhone.Text == string.Empty)
            {
                strMessage        += "\nPhone No. is required";
                validationPassed   = false;
                txtPhone.BackColor = Color.Yellow;
            }
            else
            {
                txtPhone.BackColor = Color.White;
            }



            if (cboState.Text == "--  Select State --")
            {
                strMessage        += "\nSelect a State";
                validationPassed   = false;
                cboState.BackColor = Color.Yellow;
            }
            else
            {
                cboState.BackColor = Color.White;
            }


            if (txtFileNo.Text == string.Empty)
            {
                strMessage         += "\nFile No. is required";
                validationPassed    = false;
                txtFileNo.BackColor = Color.Yellow;
            }
            else
            {
                txtFileNo.BackColor = Color.White;
            }



            if (cboDepartment.Text == "-- Select Department --")
            {
                strMessage             += "\nDepartment is required";
                validationPassed        = false;
                cboDepartment.BackColor = Color.Yellow;
            }
            else
            {
                cboDepartment.BackColor = Color.White;
            }



            if (FieldValidator.isBlank(txtNOKName.Text))
            {
                strMessage          += "\nNext of Kin Name is required";
                validationPassed     = false;
                txtNOKName.BackColor = Color.Yellow;
            }
            else
            {
                txtNOKName.BackColor = Color.White;
            }



            if (FieldValidator.isBlank(txtNOKPhone.Text))
            {
                strMessage           += "\nNext of Kin Phone No. is required";
                validationPassed      = false;
                txtNOKPhone.BackColor = Color.Yellow;
            }
            else
            {
                txtNOKPhone.BackColor = Color.Empty;
            }



            if (FieldValidator.isBlank(txtEntryFee.Text))
            {
                strMessage           += "\nEntry Fee Amount is required";
                validationPassed      = false;
                txtEntryFee.BackColor = Color.Yellow;
            }
            else
            {
                txtEntryFee.BackColor = Color.White;
            }



            if (FieldValidator.isBlank(txtRegularSavings.Text))
            {
                strMessage                 += "\nRegular Savings Amount is required";
                validationPassed            = false;
                txtRegularSavings.BackColor = Color.Yellow;
            }
            else
            {
                txtRegularSavings.BackColor = Color.White;
            }


            if (strMessage != null)
            {
                MessageBox.Show(strMessage, "New Member Validation  - From Validator", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(validationPassed);
        }
Ejemplo n.º 5
0
        private bool anyBlankField()
        {
            bool   blankFieldExist = false;
            string strMessage      = string.Empty;

            if (FieldValidator.isBlank(txt_Title.Text))
            {
                strMessage     += "Title is required";
                blankFieldExist = true;
            }

            if (FieldValidator.isBlank(txt_FileNo.Text))
            {
                strMessage     += "\nFile No. is required";
                blankFieldExist = true;
            }

            if (FieldValidator.isBlank(txt_LastName.Text))
            {
                strMessage     += "\nLast Name is required";
                blankFieldExist = true;
            }

            if (FieldValidator.isBlank(txt_FirstName.Text))
            {
                strMessage     += "\nFirst Name is required";
                blankFieldExist = true;
            }

            if (FieldValidator.isBlank(txt_Address.Text))
            {
                strMessage     += "\nAddress is required";
                blankFieldExist = true;
            }

            if (FieldValidator.isBlank(txt_LGA.Text))
            {
                strMessage     += "\nLGA is required";
                blankFieldExist = true;
            }

            if (FieldValidator.isBlank(txt_Phone.Text))
            {
                strMessage     += "\nPhone No. is required";
                blankFieldExist = true;
            }

            if (FieldValidator.isBlank(txt_NOKName.Text))
            {
                strMessage     += "\nNext of Kin Name is required";
                blankFieldExist = true;
            }

            if (FieldValidator.isBlank(txt_NOKAddress.Text))
            {
                strMessage     += "\nNext of Kin Address is required";
                blankFieldExist = true;
            }

            if (FieldValidator.isBlank(txt_NOKPhone.Text))
            {
                strMessage     += "\nNext of Kin Phone No. is required";
                blankFieldExist = true;
            }

            if (strMessage != string.Empty || blankFieldExist == true)
            {
                MessageBox.Show(strMessage, "An Error has Occurred", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(blankFieldExist);
        }