private void Click_Akk(object sender, RoutedEventArgs e) { WindowClient windowClient = new WindowClient(logins); windowClient.Show(); this.Close(); }
private void go_back(object sender, RoutedEventArgs e) { WindowClient winadm = new WindowClient(logins); this.Close(); winadm.Show(); }
private void Button_Click(object sender, RoutedEventArgs e) { string login = Email_box.Text.Trim(); string password = password_box.Password.Trim(); try { DB db = new DB(); DataTable table = new DataTable(); SqlDataAdapter adapter = new SqlDataAdapter(); SqlCommand command = new SqlCommand("SELECT * FROM Client WHERE Email= @uL AND Password = @uP", db.getConnection()); db.openConnection(); command.Parameters.Add("@uL", SqlDbType.VarChar).Value = login; command.Parameters.Add("@uP", SqlDbType.VarChar).Value = password; adapter.SelectCommand = command; adapter.Fill(table); if (table.Rows.Count > 0) { if (CheckRole()) { WindowAdmin windowCompany = new WindowAdmin(); this.Close(); windowCompany.Show(); } else { WindowClient client = new WindowClient(login); this.Close(); client.Show(); } } else { MessageBox.Show("Неправильный логин или пароль"); } } catch (SqlException) { MessageBox.Show("Отсутствует подключение с базой данных"); } }
private void go_order(object sender, RoutedEventArgs e) { DB db = new DB(); SqlCommand command = new SqlCommand("INSERT INTO OrderProduct ( Name, Price, TopPrice, Description, Login, ImagePath)" + "VALUES (@title, @price, @topprice, @desk, @login, @image)", db.getConnection()); command.Parameters.AddWithValue("@title", title_box.Text); command.Parameters.AddWithValue("@price", price_box.Text); command.Parameters.AddWithValue("@topprice", topprice_box.Text); command.Parameters.AddWithValue("@desk", desk_box.Text); command.Parameters.AddWithValue("@login", logins); command.Parameters.AddWithValue("@image", Tovar.MainImagePath); db.openConnection(); if (command.ExecuteNonQuery() == 1) { WindowClient winadm = new WindowClient(logins); MessageBox.Show("Товар успешно зарезервирована!"); this.Close(); winadm.Show(); } }
private void Client_OnClick(object sender, RoutedEventArgs e) { WindowClient wEmployee = new WindowClient(); wEmployee.Show(); }