Ejemplo n.º 1
0
        private int CheckData() // get back quantity of errors
        {
            bool check;
            int  i = 0;

            check = ErrorControls.EmptyTextBox(tbTitle);
            ErrorControls.CountErrors(ref i, check);

            check = ErrorControls.EmptyTextBox(tbPhone);
            ErrorControls.CountErrors(ref i, check);

            check = ErrorControls.EmptyTextBox(tbAddress);
            ErrorControls.CountErrors(ref i, check);

            check = ErrorControls.EmptyTextBox(tbGpsX);
            if (check)
            {
                check = ErrorControls.TextBoxToDouble(tbGpsX);
            }
            ErrorControls.CountErrors(ref i, check);

            check = ErrorControls.EmptyTextBox(tbGpsY);
            if (check)
            {
                check = ErrorControls.TextBoxToDouble(tbGpsY);
            }
            ErrorControls.CountErrors(ref i, check);


            check = ErrorControls.EmptyTextBox(tbCashier);
            ErrorControls.CountErrors(ref i, check);

            check = ErrorControls.EmptyTextBox(tbDescription);
            ErrorControls.CountErrors(ref i, check);

            if (lbServices.SelectedItems.Count == 0)
            {
                check = false;
                lbServices.BackColor = Color.Red;
            }
            else
            {
                check = true;
                lbServices.BackColor = Color.White;
            }
            ErrorControls.CountErrors(ref i, check);

            return(i);
        }
Ejemplo n.º 2
0
        private int CheckData() // get back quantity of errors
        {
            bool check;
            int  i = 0;

            check = ErrorControls.EmptyTextBox(tbTitle);
            ErrorControls.CountErrors(ref i, check);
            check = ErrorControls.EmptyTextBox(tbCode);
            if (check)
            {
                check = ErrorControls.RegexTextBox(tbCode, "^[0-9]+$");
            }
            ErrorControls.CountErrors(ref i, check);

            return(i);
        }