private void thanabox_SelectedIndexChanged(object sender, EventArgs e) { Union u = new Union(); Thana t = new Thana(); District d = new District (); try { thana_no.Text = t.getThanaNo(thanabox.Text.ToString(), Convert.ToInt32(district_no.Text.ToString())).ToString(); String thanaid = "D" + district_no.Text + "T" + thana_no.Text + ""; unionbox.DataSource = u.getUnionList(thanaid); unionbox.SelectedIndex = -1; unionbox.Select(); } catch (Exception ex) { } }
private void MainForm_Load(object sender, EventArgs e) { District d = new District(); districtbox.Items.Clear(); districtbox.DataSource = d.getDistrictList(); districtbox.SelectedIndex=-1; userbox.Select(); }
private void districtbox_SelectedIndexChanged(object sender, EventArgs e) { thanabox.Text = null; Thana t = new Thana(); District d = new District(); try { district_no.Text = d.getDistrictNo(districtbox.Text.ToString()).ToString(); thanabox.DataSource = t.getThanaList(Convert.ToInt32(district_no.Text.ToString())); thanabox.SelectedIndex = -1; thanabox.Select(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void district_no_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { try { District d = new District(); Thana t = new Thana(); districtbox.Text = d.getDistrictName(Convert.ToInt32(district_no.Text)); thanabox.DataSource = t.getThanaList(d.getDistrictNo(districtbox.Text.ToString())); thana_no.Select(); } catch (Exception ex) {MessageBox.Show(ex.ToString()); } } }
public MainForm() { InitializeComponent(); District d = new District(); districtbox.DataSource = d.getDistrictList(); }