private void cmb_type_SelectedIndexChanged(object sender, EventArgs e)
 {
     cmb_batch.DataSource = General_methods.fill_batches_combobox(cmb_type.Text);
     if (cmb_type.SelectedIndex == 0)
     {
         state = false;
     }
     else
     {
         state = true;
     }
 }
 private void cmb_type_SelectedIndexChanged(object sender, EventArgs e)
 {
     cmb_module.DataSource = null;
     cmb_module.Text       = "";
     txt_no.Text           = "";
     if (cmb_type.SelectedIndex == 0)
     {
         cmb_batch.Enabled   = true;
         cmb_name.DataSource = General_methods.fill_course_combobox("Diploma");
         ctype = "Diploma";
         cmb_module.Enabled    = true;
         txt_venue.Text        = "NILS";
         groupBox1.Enabled     = false;
         txt_venue.Enabled     = false;
         txt_progtitle.Enabled = false;
         txt_progtitle.Text    = "None";
         cmb_name.Enabled      = true;
         rbn_in.Checked        = true;
         rbn_out.Checked       = false;
         cmb_batch.DataSource  = General_methods.fill_batches_combobox("Diploma");
         cmb_name.Enabled      = false;
     }
     if (cmb_type.SelectedIndex == 1)
     {
         cmb_batch.Enabled   = true;
         cmb_name.DataSource = General_methods.fill_course_combobox("Certificate");
         ctype = "Certificate";
         cmb_module.Enabled    = false;
         groupBox1.Enabled     = false;
         txt_venue.Text        = "NILS";
         txt_venue.Enabled     = false;
         txt_progtitle.Enabled = false;
         txt_progtitle.Text    = "None";
         cmb_name.Enabled      = true;
         rbn_in.Checked        = true;
         rbn_out.Checked       = false;
         cmb_batch.DataSource  = General_methods.fill_batches_combobox("Certificate");
         cmb_name.Enabled      = false;
     }
     if (cmb_type.SelectedIndex == 2)
     {
         cmb_name.Enabled    = true;
         cmb_name.DataSource = General_methods.fill_course_combobox("Short");
         ctype = "One-day";
         cmb_module.Enabled    = false;
         groupBox1.Enabled     = true;
         txt_venue.Enabled     = true;
         txt_progtitle.Enabled = false;
         txt_progtitle.Text    = "None";
         cmb_name.Enabled      = true;
         txt_venue.Text        = "";
         cmb_batch.Enabled     = false;
     }
     if (cmb_type.SelectedIndex == 3)
     {
         cmb_name.Enabled    = true;
         cmb_name.DataSource = General_methods.fill_course_combobox("Short");
         ctype = "Two-day";
         cmb_module.Enabled    = false;
         groupBox1.Enabled     = true;
         txt_venue.Enabled     = true;
         txt_progtitle.Enabled = false;
         txt_progtitle.Text    = "None";
         cmb_name.Enabled      = true;
         txt_venue.Text        = "";
         cmb_batch.Enabled     = false;
     }
     if (cmb_type.SelectedIndex == 4)
     {
         cmb_name.Enabled    = true;
         cmb_name.DataSource = General_methods.fill_course_combobox("Short");
         ctype = "Three-day";
         cmb_module.Enabled    = false;
         groupBox1.Enabled     = true;
         txt_venue.Enabled     = true;
         txt_progtitle.Enabled = false;
         txt_progtitle.Text    = "None";
         cmb_name.Enabled      = true;
         txt_venue.Text        = "";
         cmb_batch.Enabled     = false;
     }
     if (cmb_type.SelectedIndex == 5)
     {
         cmb_name.Enabled      = true;
         ctype                 = "Workshop";
         groupBox1.Enabled     = true;
         txt_venue.Enabled     = true;
         ctype                 = "Workshop";
         txt_progtitle.Enabled = true;
         txt_progtitle.Text    = "";
         cmb_name.Enabled      = false;
         cmb_module.Enabled    = false;
         cmb_module.Text       = "";
         cmb_name.Text         = "";
         cmb_name.DataSource   = null;
         txt_venue.Text        = "";
         //txt_venue.ReadOnly = false;
         cmb_batch.Enabled = false;
     }
 }