private void cmb_type_SelectedIndexChanged(object sender, EventArgs e) { if (cmb_type.SelectedIndex == 0) { cmb_name.DataSource = General_methods.fill_course_combobox("Diploma"); } else if (cmb_type.SelectedIndex == 1) { cmb_name.DataSource = General_methods.fill_course_combobox("Certificate"); } cmb_name.SelectedIndex = 0; }
private void cmb_type_SelectedIndexChanged(object sender, EventArgs e) { if (cmb_type.SelectedIndex == 0) { cmb_course_1.DataSource = General_methods.fill_course_combobox("Diploma"); type = "Diploma"; } if (cmb_type.SelectedIndex == 1) { cmb_course_1.DataSource = General_methods.fill_course_combobox("Certificate"); type = "Certificate"; } cmb_batch.Items.Clear(); cmb_batch.Text = ""; cmb_medium.Text = ""; txt_studno_1.Text = ""; }
private void cmb_type_2_SelectedIndexChanged(object sender, EventArgs e) { if (cmb_type_2.SelectedIndex == 0) { /*cmb_module_2.Enabled = true; * con.Open(); * SqlCommand cmd1 = new SqlCommand(("SELECT course_name FROM Dip_course_details"), con); * SqlDataReader dr1 = cmd1.ExecuteReader(); * int count = 0; * string[] name = new string[100]; * while (dr1.Read()) * { * name[count] = Convert.ToString(dr1.GetValue(0)); * count++; * } * cmb_name1.DataSource = name; * dr1.Close(); * con.Close();*/ ctype = "Diploma"; cmb_module_2.Enabled = true; cmb_name1.DataSource = General_methods.fill_course_combobox("Diploma"); txt_venue.Enabled = false; } else if (cmb_type_2.SelectedIndex == 1) { /*con.Open(); * SqlCommand cmd1 = new SqlCommand(("SELECT course_name FROM certif_course_details"), con); * SqlDataReader dr1 = cmd1.ExecuteReader(); * int count = 0; * string[] name = new string[100]; * while (dr1.Read()) * { * name[count] = Convert.ToString(dr1.GetValue(0)); * count++; * } * cmb_name1.DataSource = name; * dr1.Close(); * con.Close();*/ ctype = "Certificate"; cmb_module_2.DataSource = null; cmb_module_2.Enabled = false; cmb_name1.DataSource = General_methods.fill_course_combobox("Certificate"); txt_venue.Enabled = false; } else if (cmb_type_2.SelectedIndex == 2) { /*con.Open(); * SqlCommand cmd1 = new SqlCommand(("SELECT course_name FROM Short_course_details"), con); * SqlDataReader dr1 = cmd1.ExecuteReader(); * int count = 0; * string[] name = new string[100]; * while (dr1.Read()) * { * name[count] = Convert.ToString(dr1.GetValue(0)); * count++; * } * cmb_name1.DataSource = name; * dr1.Close(); * con.Close();*/ ctype = "One-day"; cmb_module_2.DataSource = null; cmb_module_2.Enabled = false; cmb_name1.DataSource = General_methods.fill_course_combobox("Short"); txt_venue.Enabled = true; } else if (cmb_type_2.SelectedIndex == 3) { /*con.Open(); * SqlCommand cmd1 = new SqlCommand(("SELECT course_name FROM Short_course_details"), con); * SqlDataReader dr1 = cmd1.ExecuteReader(); * int count = 0; * string[] name = new string[100]; * while (dr1.Read()) * { * name[count] = Convert.ToString(dr1.GetValue(0)); * count++; * } * cmb_name1.DataSource = name; * dr1.Close(); * con.Close();*/ ctype = "Two-day"; cmb_module_2.DataSource = null; cmb_module_2.Enabled = false; cmb_name1.DataSource = General_methods.fill_course_combobox("Short"); txt_venue.Enabled = true; } else if (cmb_type_2.SelectedIndex == 4) { /*con.Open(); * SqlCommand cmd1 = new SqlCommand(("SELECT course_name FROM Short_course_details"), con); * SqlDataReader dr1 = cmd1.ExecuteReader(); * int count = 0; * string[] name = new string[100]; * while (dr1.Read()) * { * name[count] = Convert.ToString(dr1.GetValue(0)); * count++; * } * cmb_name1.DataSource = name; * dr1.Close(); * con.Close();*/ ctype = "Three-day"; cmb_module_2.DataSource = null; cmb_module_2.Enabled = false; cmb_name1.DataSource = General_methods.fill_course_combobox("Short"); txt_venue.Enabled = true; } else if (cmb_type_2.SelectedIndex == 5) { /*con.Open(); * SqlCommand cmd1 = new SqlCommand(("SELECT course_name FROM Short_course_details"), con); * SqlDataReader dr1 = cmd1.ExecuteReader(); * int count = 0; * string[] name = new string[100]; * while (dr1.Read()) * { * name[count] = Convert.ToString(dr1.GetValue(0)); * count++; * } * cmb_name1.DataSource = name; * dr1.Close(); * con.Close();*/ ctype = "Workshop"; cmb_module_2.DataSource = null; cmb_module_2.Enabled = false; //cmb_name1.DataSource = General_methods.fill_course_combobox("Short"); txt_venue.Enabled = 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; } }