private void AddForm_Shown(object sender, EventArgs e) { //using (MySQLConnector con = new MySQLConnector()) MySQLConnector msc = MySQLConnector.GetInstance(); { curTownComBox.DataSource = msc.SelectInformation(0); curTownComBox.DisplayMember = "town_Name"; offTownComBox.DataSource = msc.SelectInformation(0); offTownComBox.DisplayMember = "town_Name"; familyComBox.DataSource = msc.SelectInformation(1); familyComBox.DisplayMember = "condition"; citizenComBox.DataSource = msc.SelectInformation(3); citizenComBox.DisplayMember = "countries"; invalidComBox.DataSource = msc.SelectInformation(2); invalidComBox.DisplayMember = "invalid_cond"; } fnameBox.Focus(); }
private void srchBtn_Click(object sender, EventArgs e) { using (MySQLConnector connector = new MySQLConnector()) { if (type == Type.Users) parent.ShowSearch(connector.SelectInformation(fnameTBox.Text.Trim(), snameTBox.Text.Trim(), fatNameTBox.Text.Trim())); else if (snameTBox.Text.Length>0) if (!Int32.TryParse(snameTBox.Text, out num)) num = 0; } this.Close(); }
private void ShowInfoBtn_Click(object sender, EventArgs e) { MySQLConnector msc = MySQLConnector.GetInstance(); { try { InfoDataGrid.DataSource = msc.SelectInformation(); InfoDataGrid.Columns[0].Visible = false; } catch (Exception) { MessageBox.Show("Empty base"); } } }
private void srchBtn_Click(object sender, EventArgs e) { using (MySQLConnector connector = new MySQLConnector()) { if (type == Type.Users) { parent.ShowSearch(connector.SelectInformation(fnameTBox.Text.Trim(), snameTBox.Text.Trim(), fatNameTBox.Text.Trim())); } else if (snameTBox.Text.Length > 0) { if (!Int32.TryParse(snameTBox.Text, out num)) { num = 0; } } } this.Close(); }