Beispiel #1
0
        /// <summary>
        /// method to check if the user put correct input in the customer fields
        /// </summary>
        /// <returns>
        /// res = true - all inputs correct
        /// res = false - one or more from the inputs is incorrect
        /// </returns>
        public bool inputChecks()
        {
            bool res = true;

            if (Checks.IsEmptyString(txtCustomerFname.Text) || Checks.IsEmptyString(txtCustomerLname.Text) ||
                Checks.IsEmptyString(txtCustomerPhone.Text) || Checks.IsEmptyString(txtCustomerEmail.Text))
            {
                res = false;
                MessageBox.Show("אחד או יותר מהשדות ריקים!");
            }
            else if (!Checks.IsStringIsContainLettersOrNumbers(txtCustomerFname.Text))
            {
                res = false;
                MessageBox.Show("שם פרטי יכול להכיל רק אותיות בעברית!");
            }
            else if (!Checks.IsStringIsContainLettersOrNumbers(txtCustomerLname.Text))
            {
                res = false;
                MessageBox.Show("שם משפחה יכול להכיל רק אותיות בעברית!");
            }
            else if (!Checks.IsValidEmail(txtCustomerEmail.Text))
            {
                res = false;
                MessageBox.Show("אימייל לא חוקי!");
            }
            else if (!Checks.IsValidPhone(txtCustomerPhone.Text))
            {
                res = false;
                MessageBox.Show("טלפון לא חוקי !");
            }
            return(res);
        }
Beispiel #2
0
        /// <summary>
        /// method to check if the user put correct input in the employee fields
        /// </summary>
        /// <returns>
        /// res = true - all inputs correct
        /// res = false - one or more from the inputs is incorrect
        /// </returns>
        public bool inputChecks()
        {
            bool res = true;

            if (Checks.IsEmptyString(txtEmployeeLname.Text) || Checks.IsEmptyString(txtEmployeeName.Text))
            {
                res = false;
                MessageBox.Show("אחד או יותר מהשדות ריקים!", " הודעת מערכת ", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (!Checks.IsStringIsContainLettersOrNumbers(txtEmployeeName.Text))
            {
                res = false;
                MessageBox.Show("שם פרטי יכול להכיל רק אותיות בעברית!", " הודעת מערכת ", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(res);
        }