Exemple #1
0
        private int ValidatePersonalPage()
        {
            int flag = 0;

            if (surname.Trim() == "")
            {
                tbSurname.Focus();
                epUserAccount.SetError(tbSurname, "Fill in The surname");
                flag = 1;
            }
            if (firstname.Trim() == "")
            {
                tbFirstname.Focus();
                epUserAccount.SetError(tbFirstname, "Fill in The firstname");
                flag = 1;
            }
            if (othername.Trim() == "")
            {
                tbUsername.Focus();
                epUserAccount.SetError(tbUsername, "Fill in The username");
                flag = 1;
            }
            if (residence.Trim() == "")
            {
                tbRessidence.Focus();
                epUserAccount.SetError(tbRessidence, "Requires a Category");
                flag = 1;
            }
            if ((rbfemale.Checked == false) && (rbmale.Checked == false))
            {
                gbGender.Focus();
                epUserAccount.SetError(gbGender, "Select a Gender");
                flag = 1;
            }
            if (phonenumber.Trim() == "")
            {
                tbPhonenumber.Focus();
                epUserAccount.SetError(tbPhonenumber, "Requires Phonenumber");
                flag = 1;
            }
            if (DOB.Trim() == "")
            {
                dtpDOB.Focus();
                epUserAccount.SetError(dtpDOB, "Requires Date of Birth");
                flag = 1;
            }
            return(flag);
        }