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()); }
            }
        }
        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(), d.getDistrictNo(districtbox.Text)).ToString();
                String thanaid = "D" + district_no.Text + "T" + thana_no.Text + "";
                unionbox.DataSource = u.getUnionList(thanaid);
                unionbox.Select();
            }
            catch (Exception ex) { }
        }