예제 #1
0
        private bool trySave()
        {
            bool blad = false;

            if (xPINcode.Text.Length != 4)
            {
                blad = true;
            }
            else
            {
                for (int i = 0; i < xPINcode.Text.Length; i++)
                {
                    if ((xPINcode.Text[i] < '0') || (xPINcode.Text[i] > '9'))
                    {
                        blad = true;
                    }
                }
            }
            if (blad)
            {
                MessageBox.Show("PIN musi składać się z 4 cyfr.", "Błędny PIN", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                xPINcode.Focus();
                return(false);
            }
            else
            {
                bws.saveSettings();
                return(true);
            }
        }