private void Form1_Load(object sender, EventArgs e) { connectinString.Open(); MySqlCommand command = connectinString.CreateCommand(); command.CommandText = "SELECT count(*) FROM hospitaldatabase.patient"; last_id = System.Convert.ToInt32(command.ExecuteScalar()); for (int i = 1; i <= last_id; i++) { comboBox1.Items.Add(i); } connectinString.Close(); Form_Login fl = new Form_Login(); fl.ShowDialog(); // Bottom status toolStripStatusLabel1.Text = "Status: ready"; }
private void exitToolStripMenuItem_Click(object sender, EventArgs e) { label1.Text = "Name:"; label2.Text = "Days:"; label3.Text = "City:"; textBox1.Text = "Name"; domainUpDown1.Text = "1"; textBox2.Text = "City"; textBox3.Text = ""; textBox4.Text = ""; comboBox1.Text = "-select id-"; listBox1.Items.Clear(); listBox1.Items.Add("ID | Name | Days | City"); // exit to login form Form_Login fl = new Form_Login(); fl.ShowDialog(); }