private void button1_Click(object sender, EventArgs e) { Inventry_Control_System gh = new Inventry_Control_System(); gh.EnterCashier(comboBox1.SelectedItem.ToString()); gh.ShowDialog(); gh.Activate(); this.Close(); }
private void Select_Cashier_Load(object sender, EventArgs e) { OleDbConnection Connection = new OleDbConnection(Con.ConnectionString()); Connection.Open(); OleDbCommand SELCashier = new OleDbCommand("SELECT CashierID FROM Cashier", Connection); OleDbDataReader hh = SELCashier.ExecuteReader(); while (hh.Read()) { comboBox1.Items.Add(hh["CashierID"].ToString()); } hh.Close(); Connection.Close(); if (comboBox1.Items.Count == 1) { comboBox1.SelectedIndex = 0; Inventry_Control_System ip = new Inventry_Control_System(); ip.EnterCashier(comboBox1.SelectedItem.ToString()); ip.ShowDialog(); ip.Activate(); this.Close(); } }