コード例 #1
0
        private void CheckCardNumber(object sender, RoutedEventArgs e)
        {
            string text = InputTextBox.Text;

            if (IsDigitsOnly(text) && text.Length == 16)
            {
                using (var db = new ClientsEntities())
                {
                    _card = db.GetCardByNumber(text);
                    if (_card != null)
                    {
                        _account = db.GetAccountById(_card.AccountID);
                        WaitingForPINState();
                        Button1.Click -= CheckCardNumber;
                    }
                    else
                    {
                        InfoTextBox.Text = "Карта с таким номером не найдена.";
                    }
                }
            }
            else
            {
                InfoTextBox.Text = "Введите корректный номер карты.";
            }
        }