private void buttonOK_Click(object sender, EventArgs e)
        {
            try
            {
                SqlConnection sqlConnection = new SqlConnection(sqlConnectionString);
                SqlCommand    query         = new SqlCommand("SELECT Логін, Пароль FROM [Акаунт клієнта] WHERE Логін = @data_0 AND Пароль = @data_1", sqlConnection);
                SqlParameter  uName         = new SqlParameter("@data_0", SqlDbType.NVarChar);
                SqlParameter  uPassword     = new SqlParameter("@data_1", SqlDbType.VarChar);

                uName.Value     = textBox7.Text;
                uPassword.Value = textBox1.Text;


                query.Parameters.Add(uName);
                query.Parameters.Add(uPassword);
                query.Connection.Open();

                SqlDataReader myReader = query.ExecuteReader(CommandBehavior.CloseConnection);

                if (myReader.Read() == true)
                {
                    MessageBox.Show("Ви успішно увійшли до акаунту " + textBox7.Text);
                                         this.Hide();

                    clientPage = new ClientPage(textBox7.Text);
                    clientPage.Show();
                }
                else
                {
                    MessageBox.Show("Щось трапилось, перевірте дані", "Помилка", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    textBox7.Clear();
                    textBox1.Clear();
                    textBox7.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #2
0
 public GroupFilter(ClientPage clientPage)
 {
     InitializeComponent();
     this.clientPage = clientPage;
 }
Beispiel #3
0
 public SeasonTicketFilter(ClientPage clientPage)
 {
     InitializeComponent();
     this.clientPage = clientPage;
 }
 public CoachScheduleFilter(ClientPage clientPage)
 {
     InitializeComponent();
     this.clientPage = clientPage;
 }