Exemplo n.º 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);
        }
Exemplo n.º 2
0
        /// <summary>
        /// method to check if the user put correct input in the event 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(txtOwnerFname.Text) || Checks.IsEmptyString(txtOwnerLname.Text) ||
                Checks.IsEmptyString(txtOwnerPhone.Text) || Checks.IsEmptyString(txtOwnerMail.Text) ||
                Checks.IsEmptyString(txtEventType.Text) || Checks.IsEmptyString(txtEventParticipants.Text))
            {
                MessageBox.Show("אחד או יותר מהשדות ריקים, אנא הכנס את כל השדות");
                res = false;
            }
            else
            {
                if (!Checks.IsValidEmail(txtOwnerMail.Text))
                {
                    MessageBox.Show("מייל לא תקין!");
                    res = false;
                }
                else if (!Checks.IsValidPhone(txtOwnerPhone.Text))
                {
                    MessageBox.Show("טלפון לא תקין!");
                    res = false;
                }
                else if (!Checks.IsValidPhone(txtEventParticipants.Text))
                {
                    MessageBox.Show("השדה מספר משתפפים יכול להכיל רק מספרים!");
                    res = false;
                }
                else if (int.Parse(txtEventParticipants.Text) < 1)
                {
                    MessageBox.Show("מספר המשתתפים חייב להיות גדול מ 0!");
                    res = false;
                }
                else if (dtpEventTime.Text == "00:00:00")
                {
                    MessageBox.Show("הכנס שעת האירוע!");
                    res = false;
                }
            }
            return(res);
        }