Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Form FormPokup = new PokupForm(0, 0);

            FormPokup.Show();
            this.Hide();
        }
Exemple #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex == 1 ^ comboBox1.SelectedIndex == 2)
     {
         Form FormPokup = new PokupForm("0", "0", id_Goroda);
         FormPokup.Show();
         this.Hide();
     }
     else
     {
         MessageBox.Show("Нужно выбрать город", "Ошибка", MessageBoxButtons.OK);
     }
 }
Exemple #3
0
        private void EnterToSystem(SqlConnection trycon)
        {
            bool CardOk  = false;
            int  LogCard = Int32.Parse(textBox_Card.Text);

            scommand = new SqlCommand(sc_getCard, trycon);
            using (DbDataReader reader = scommand.ExecuteReader())
            {
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        if (LogCard == reader.GetInt32(0))
                        {
                            CardOk   = true;
                            Num_card = reader.GetInt32(0);
                            Balance  = reader.GetInt32(5);
                        }
                    }
                    if (CardOk == true)
                    {
                        Form FormPokup = new PokupForm(Num_card, Balance);
                        FormPokup.Show();
                        this.Hide();
                        CardOk = false;
                    }
                    else
                    {
                        if (CardOk == false)
                        {
                            MessageBox.Show("Номер карты отстутсвует в списке. Попробуйте ввести другие данные.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
        }
Exemple #4
0
        private void EnterToSystem(SqlConnection trycon)
        {
            bool CardOk  = false;
            int  LogCard = Int32.Parse(textBox_Card.Text);

            scommand = new SqlCommand(sc_getCard, trycon);
            using (DbDataReader reader = scommand.ExecuteReader())
            {
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        if (LogCard == reader.GetInt32(0))
                        {
                            CardOk   = true;
                            Num_card = reader.GetString(1);
                            Balance  = reader.GetString(2);
                        }
                    }
                    if (CardOk == true && comboBox1.SelectedIndex != 0)
                    {
                        Form FormPokup = new PokupForm(Num_card, Balance, id_Goroda);
                        FormPokup.Show();
                        this.Hide();
                        CardOk = false;
                    }
                    else
                    {
                        if (CardOk == false)
                        {
                            MessageBox.Show("Пользователь с таким логином и/или паролем не найден", "Ошибка", MessageBoxButtons.OK);
                        }
                    }
                }
            }
        }