Example #1
0
        private void button14_Click(object sender, EventArgs e)
        {
            L1 = new laboratorist();
            string a;

            if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "")
            {
                if (radioButton1.Checked)
                {
                    a = "male";
                    L1.insert(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, a);
                }

                else if (radioButton2.Checked)
                {
                    a = "female";
                    L1.insert(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, a);
                }

                MessageBox.Show("Data Inserted");
            }

            else
            {
                MessageBox.Show("Error! Please Insert Complete Data");
            }
        }
Example #2
0
        private void button11_Click(object sender, EventArgs e)
        {
            L1 = new laboratorist();
            DataTable tbl = new DataTable();

            tbl = L1.ShowTable("SELECT * FROM laboratorist");
            dataGridView1.DataSource = tbl;
        }
Example #3
0
 private void button12_Click(object sender, EventArgs e)
 {
     if (comboBox3.Text != "")
     {
         L1 = new laboratorist();
         L1.delete(Convert.ToInt32(comboBox3.Text));
         MessageBox.Show("Data Deleted");
     }
     else
     {
         MessageBox.Show("Please Select An Id");
     }
 }
Example #4
0
 private void button9_Click(object sender, EventArgs e)
 {
     if (comboBox1.Text != "")
     {
         L1 = new laboratorist();
         DataTable tbl = new DataTable();
         tbl = L1.ShowTable("SELECT * FROM laboratorist WHERE ID = '" + comboBox1.Text + "'");
         dataGridView1.DataSource = tbl;
         dataGridView1.DataSource = tbl;
     }
     else
     {
         MessageBox.Show("Please Select An Id");
     }
 }