private void viewSummaryStockOutButton_Click(object sender, EventArgs e) { SearchViewItemSummaryForm searchViewItemSummaryForm = new SearchViewItemSummaryForm(); this.Close(); thread = new Thread(OpenViewSummaryForm); thread.SetApartmentState(ApartmentState.STA); thread.Start(); }
private void loginButton_Click(object sender, EventArgs e) { string conString = ConfigurationManager.ConnectionStrings["stockManagementSystemConnection"].ConnectionString; string query = "SELECT * FROM Login WHERE Username='******' AND Password='******'"; SqlDataAdapter sda = new SqlDataAdapter(query, conString); DataTable dtbl = new DataTable(); sda.Fill(dtbl); if (dtbl.Rows.Count >= 1) { SearchViewItemSummaryForm startForm = new SearchViewItemSummaryForm(); //StockMenu menu = new StockMenu(); //menu.Show(); //this.Hide(); startForm.Show(); this.Hide(); } else { MessageBox.Show("Please, check your username and password."); } }