public int checkIfThereIsNOBLankTB()

        {
            int res = 0;

            if (String.IsNullOrEmpty(fnametb.Text) || String.IsNullOrEmpty(lnametb.Text) || String.IsNullOrEmpty(idtb.Text) || String.IsNullOrEmpty(adresstb.Text) || String.IsNullOrEmpty(phonetb.Text) || String.IsNullOrEmpty(passwordBox.Password.ToString()))
            {
                res++;
            }
            if (res == 0)
            {
                //check errors
                bool containsInt  = fnametb.Text.Any(char.IsDigit);
                bool cont_spaical = f.CheckSpacialCherter(fnametb.Text);
                if (containsInt == true || cont_spaical == true)
                {
                    res++;
                }
                if (f.CheckIDNo(idtb.Text) == false)
                {
                    res++;
                }
                containsInt  = lnametb.Text.Any(char.IsDigit);
                cont_spaical = f.CheckSpacialCherter(lnametb.Text);
                if (containsInt == true || cont_spaical == true)
                {
                    res++;
                }
                bool conset_phone_digit_check = f.IsDigitsOnly(phonetb.Text);
                if (conset_phone_digit_check == false)
                {
                    res++;
                }
            }


            return(res);
        }
        private void okbtn_Click(object sender, RoutedEventArgs e)
        {
            string errors       = "";
            int    errors_count = 0;

            if (f.CheckForInternetConnection())
            {
                if (fnametb.Text != "")
                {
                    bool containsInt  = fnametb.Text.Any(char.IsDigit);
                    bool cont_spaical = f.CheckSpacialCherter(fnametb.Text);
                    if (containsInt == true || cont_spaical == true)
                    {
                        errors += "\n שם לא יכול להכי תווים מיוחדים או מספרים"; errors_count++;
                    }
                    else
                    {
                        this.e.firstname = fnametb.Text;
                    }
                }
                else
                {
                    errors += "\n שם לא יכול להיות ריק"; errors_count++;
                }
                if (idnumbertb.Text != "")
                {
                    if (f.CheckIDNo(idnumbertb.Text))
                    {
                        this.e.employee_id_number = idnumbertb.Text;
                    }
                    else
                    {
                        errors += "\n תעודת זהות אינה תקינה"; errors_count++;
                    }
                }
                if (lnametb.Text != "")
                {
                    bool containsInt  = lnametb.Text.Any(char.IsDigit);
                    bool cont_spaical = f.CheckSpacialCherter(lnametb.Text);
                    if (containsInt == true || cont_spaical == true)
                    {
                        errors += "\n שם לא יכול להכי תווים מיוחדים או מספרים"; errors_count++;
                    }
                    else
                    {
                        this.e.lastname = lnametb.Text;
                    }
                }
                else
                {
                    errors += "\n שם משפחה לא יכול להיות ריק";
                    errors_count++;
                }
                if (adresstb.Text != "")
                {
                    this.e.adress = adresstb.Text;
                }
                else
                {
                    errors += "\n כתובת אינה יכולה להיות ריקה";
                    errors_count++;
                }
                if (phonetb.Text != "")
                {
                    bool conset_phone_digit_check = f.IsDigitsOnly(phonetb.Text);
                    if (conset_phone_digit_check == false)
                    {
                        errors += "\n טלפון לא יכול להכיל תווים חוץ ממספרים"; errors_count++;
                    }
                    else
                    {
                        this.e.phone = phonetb.Text;
                    }
                }
                else
                {
                    errors += "\n טלפון אינו יכול להיות ריק";
                    errors_count++;
                }
                if (passwordBox.Password != "")
                {
                    this.e.password = f.strEncryptred(passwordBox.Password);
                }
                if (errors_count == 0)
                {
                    f.commit_employee(this.e);
                    MessageBox.Show("בוצע בהצלחה");
                    compnaymanage cm = new compnaymanage(this.c, this.u);
                    cm.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show(errors);
                }
            }
            else
            {
                MessageBox.Show("אין חיבור לאינטרנט");
            }
        }