public FormAddSchedule(DBconnector.DBconnector connector) { InitializeComponent(); this.connector = connector; DataTable dt = new DataTable(); string result = this.connector.GetProducts(dt); if (result != "") { MessageBox.Show("Could not get products"); } else { foreach(DataRow row in dt.Rows) { comboBox.Items.Add(row["SKU"].ToString()); } if (comboBox.Items.Count != 0) { comboBox.SelectedIndex = 0; } } }
public FormAddUser(DBconnector.DBconnector connector) { InitializeComponent(); this.connector = connector; if (comboBoxUserType.Items.Count != 0) { comboBoxUserType.SelectedIndex = 0; } }
public FormLogin() { InitializeComponent(); this.errorConnection = ""; ConnectionStringSettings settings = null; try { settings = ConfigurationManager.ConnectionStrings[1]; } catch (Exception ex) { this.errorConnection = ex.Message; } if (settings != null) { this.connectionString = settings.ConnectionString; try { this.connector = new DBconnector.DBconnector(this.connectionString); this.errorConnection = this.connector.TestConnection(); } catch (Exception ex) { this.errorConnection = ex.Message; } } if (settings == null || errorConnection != "") { MessageBox.Show("Could not Connect to the Database:\n" + errorConnection); this.buttonLogin.Enabled = false; } }
public FormRemoveUser(DBconnector.DBconnector connector) { InitializeComponent(); this.connector = connector; }