private void button4_Click(object sender, EventArgs e) { if (SearchText.Text.Length > 0 && collection.Contains(SearchText.Text)) { var addstring = SearchText.Text; if (listBox1.Items.Count >= 10) { MessageBox.Show("Sie können nicht mehr als 10 Mitarbeiter auswählen"); } else { if (!listBox1.Items.Contains(addstring)) { abrechnungsnummernAnzeigeList.Add(collectionnumbers[collection.IndexOf(addstring)]); listBox1.Items.Add(addstring); } } } else { Meldung mld = new Meldung(); mld.Informationstring = "Mitarbeiter konnte nicht hinzugefügt \nwerden"; mld.Show(); SearchText.SelectAll(); } }
private void AdministrativerBereich_Load(object sender, EventArgs e) { System.Threading.Thread.Sleep(10); Meldung mld = new Meldung(); mld.Show(); mld.Close(); PW = panel1.Height; panel1.Height = 0; Hided = true; sql = new SQL(); sql.OpenCon(); dt1.Clear(); dt2.Clear(); dt3.Clear(); dt4.Clear(); dt5.Clear(); button2.FlatAppearance.BorderColor = Color.DarkSlateGray; button10.FlatAppearance.BorderColor = Color.DarkSlateGray; pictureBox2.Visible = false; Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, 591, 510, 20, 20)); var cst = new CustomColorTable(); menuStrip1.Renderer = new myRenderer(cst); tabControl1.Appearance = TabAppearance.Buttons; tabControl1.SizeMode = TabSizeMode.Fixed; dt1 = sql.loadData("Select * from Abteilung", AbteilungenDT); dt2 = sql.loadData("Select * from Arbeitsstunden", ArbeitsstundenDT); dt3 = sql.loadData("Select * from Bonuszahlung", BonuszahlungDT); dt4 = sql.loadData("Select * from Lohngruppe", LohngruppenDT); dt5 = sql.loadData("Select * from Überstundenkennung", ÜberstundenDT); dataGridView1.DataSource = dt1; dataGridView2.DataSource = dt2; dataGridView3.DataSource = dt3; dataGridView4.DataSource = dt4; dataGridView5.DataSource = dt5; dataGridView2.Columns[0].ReadOnly = true; dataGridView2.Columns[1].ReadOnly = true; dataGridView3.Columns[0].ReadOnly = true; dataGridView3.Columns[1].ReadOnly = true; dataGridView4.Columns[0].ReadOnly = true; dataGridView4.Columns[1].ReadOnly = true; dataGridView4.Columns[2].ReadOnly = true; dataGridView5.Columns[0].ReadOnly = true; dataGridView5.Columns[1].ReadOnly = true; dataGridView1.Columns[1].Width = 360; dataGridView5.Columns[1].Width = 142; dataGridView5.Columns[0].Width = 140; }