private void thana_no_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == 13)
            {
                try
                {
                    Thana t = new Thana();
                    thanabox.Text = t.getThanaName(t.generateThanaID(Convert.ToInt32(district_no.Text), Convert.ToInt32(thana_no.Text)));
                    Union u = new Union();
                    unionbox.DataSource = u.getUnionList(t.generateThanaID(Convert.ToInt32(district_no.Text), Convert.ToInt32(thana_no.Text)));
                    union_no.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(), 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 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()); }
 }