protected void GetData(string navyid) { DataRow dr = null; if (!string.IsNullOrEmpty(navyid)) { dr = dcore.GetSearchPeople(navyid); } if (dr != null) { if (!string.IsNullOrEmpty(dr["yearin"].ToString())) { lblyearintext.Text = dr["yearin"].ToString(); } else { lblyearintext.Text = "-"; } if (!string.IsNullOrEmpty(dr["unit3"].ToString())) { lblunittext.Text = dr["unit3"].ToString(); } else { lblunittext.Text = "-"; } if (!string.IsNullOrEmpty(dr["oldyearin"].ToString())) { lbloldyearintext.Text = dr["oldyearin"].ToString(); } else { lbloldyearintext.Text = "-"; } lblname.Text = dr["name"].ToString(); lblsname.Text = dr["sname"].ToString(); label10.Text = dr["id13"].ToString(); if (!string.IsNullOrEmpty(dr["report_number"].ToString())) { txtaddress_old.Text = dr["address_out"].ToString(); txtaddress_mu_old.Text = dr["address_mu_out"].ToString(); txtaddress_soid_old.Text = dr["address_soid_out"].ToString(); txtaddress_road_old.Text = dr["address_road_out"].ToString(); string tcode = dr["towncode_out"].ToString(); try { townnameManage.LoadProvinceToComboBox(cmbprovince_old, tcode); cmbprovince_old.SelectedValue = tcode.Substring(0, 2) + "0000"; townnameManage.LoadCityToComboBox(cmbdistrict_old, tcode.Substring(0, 2) + "0000", tcode.Substring(0, 4) + "00"); townnameManage.LoadTumbonToComboBox(cmbsub_district_old, tcode.Substring(0, 4) + "00", tcode); } catch { } } } }
private void cbbArmtownOld_SelectedIndexChanged(object sender, EventArgs e) { cmbdistrict_old.DataSource = null; cmbsub_district_old.DataSource = null; object value = ((ComboBox)sender).SelectedValue; if (value != null) { townnameManage_old.SelectedProvince = value.ToString(); townnameManage_old.LoadCityToComboBox(cmbdistrict_old, value.ToString()); cbbCityOld_SelectedIndexChanged(cmbsub_district_old, e); } }
protected void GetData(string navyid, string selectmove) { DataRow dr = null; if (!string.IsNullOrEmpty(navyid)) { dr = dcore.GetSearchPeople(navyid); } if (dr != null) { if (!string.IsNullOrEmpty(dr["yearin"].ToString())) { lblyearintext.Text = dr["yearin"].ToString(); } else { lblyearintext.Text = "-"; } if (!string.IsNullOrEmpty(dr["unit3"].ToString())) { lblunittext.Text = dr["unit3"].ToString(); } else { lblunittext.Text = "-"; } if (!string.IsNullOrEmpty(dr["oldyearin"].ToString())) { lbloldyearintext.Text = dr["oldyearin"].ToString(); } else { lbloldyearintext.Text = "-"; } lbname.Text = dr["name"].ToString(); lblsname.Text = dr["sname"].ToString(); lblid13.Text = dr["id13"].ToString(); lbladdress_old.Text = dr["address_in"].ToString(); lbladdress_mu_old.Text = dr["address_mu_in"].ToString(); lbladdress_soid_old.Text = dr["address_soid_in"].ToString(); lbladdress_road_old.Text = dr["address_road_in"].ToString(); string tcode = dr["towncode_in"].ToString(); try { DataTable city = DataDefinition.GetTownnameLV2(tcode).Copy(); townnameManage_old.LoadProvinceToComboBox(cmbprovince_old, tcode); cmbprovince_old.SelectedValue = tcode.Substring(0, 2) + "0000"; townnameManage_old.LoadCityToComboBox(cmbdistrict_old, tcode.Substring(0, 2) + "0000", tcode.Substring(0, 4) + "00"); townnameManage_old.LoadTumbonToComboBox(cmbsub_district_old, tcode.Substring(0, 4) + "00", tcode); } catch { } lbladdress.Text = dr["address_out"].ToString(); lbladdress_mu.Text = dr["address_mu_out"].ToString(); lbladdress_soid.Text = dr["address_soid_out"].ToString(); lbladdress_road.Text = dr["address_road_out"].ToString(); string tcode_out = dr["towncode_out"].ToString(); try { DataTable city = DataDefinition.GetTownnameLV2(tcode_out).Copy(); townnameManage.LoadProvinceToComboBox(cmbprovince, tcode); cmbprovince.SelectedValue = tcode_out.Substring(0, 2) + "0000"; townnameManage.LoadCityToComboBox(cmbdistrict, tcode_out.Substring(0, 2) + "0000", tcode_out.Substring(0, 4) + "00"); townnameManage.LoadTumbonToComboBox(cmbsubdistrict, tcode_out.Substring(0, 4) + "00", tcode_out); } catch { } } }
public void GetData(string id13) { DataRow dr = null; if (modes == "new") { if (!string.IsNullOrEmpty(id13)) { dr = dcore.GetSearchPerson(id13); } if (dr != null) { txtname.Text = dr["name"].ToString(); txtlname.Text = dr["sname"].ToString(); txtid13.Text = dr["id13"].ToString(); if (!string.IsNullOrEmpty(dr["yearin"].ToString())) { lblyearintext.Text = dr["yearin"].ToString(); } else { lblyearintext.Text = "-"; } if (!string.IsNullOrEmpty(dr["unit3"].ToString())) { lblunittext.Text = dr["unit3"].ToString(); } else { lblunittext.Text = "-"; } if (!string.IsNullOrEmpty(dr["oldyearin"].ToString())) { lbloldyearintext.Text = dr["oldyearin"].ToString(); } else { lbloldyearintext.Text = "-"; } txtaddress_old.Text = dr["ADDRESS"].ToString(); txtaddress_mu_old.Text = dr["ADDRESS_MU"].ToString(); txtaddress_soid_old.Text = dr["ADDRESS_SOIL"].ToString(); txtaddress_road_old.Text = dr["ADDRESS_ROAD"].ToString(); string tcode = dr["TOWNCODE"].ToString(); try { townnameManage_old.LoadProvinceToComboBox(cmbprovince_old, tcode); cmbprovince_old.SelectedValue = tcode.Substring(0, 2) + "0000"; townnameManage_old.LoadCityToComboBox(cmbdistrict_old, tcode.Substring(0, 2) + "0000", tcode.Substring(0, 4) + "00"); townnameManage_old.LoadTumbonToComboBox(cmbsub_district_old, tcode.Substring(0, 4) + "00", tcode); } catch { } } } else { if (!string.IsNullOrEmpty(id13)) { dr = dcore.GetSearchPeople(id13, "", ""); } if (dr != null) { if (!string.IsNullOrEmpty(dr["yearin"].ToString())) { lblyearintext.Text = dr["yearin"].ToString(); } else { lblyearintext.Text = "-"; } if (!string.IsNullOrEmpty(dr["unit3"].ToString())) { lblunittext.Text = dr["unit3"].ToString(); } else { lblunittext.Text = "-"; } if (!string.IsNullOrEmpty(dr["oldyearin"].ToString())) { lbloldyearintext.Text = dr["oldyearin"].ToString(); } else { lbloldyearintext.Text = "-"; } txtname.Text = dr["name"].ToString(); txtlname.Text = dr["sname"].ToString(); txtpeoole_name.Text = dr["people_name"].ToString(); txtpeople_lname.Text = dr["people_lname"].ToString(); txtid13.Text = dr["id13"].ToString(); txtaddress_old.Text = dr["address_in"].ToString(); txtaddress_mu_old.Text = dr["address_mu_in"].ToString(); txtaddress_soid_old.Text = dr["address_soid_in"].ToString(); txtaddress_road_old.Text = dr["address_road_in"].ToString(); if (dr["people_name"].ToString() != string.Empty || dr["people_lname"].ToString() != string.Empty) { cmbchengename.Checked = true; txtpeoole_name.Enabled = true; txtpeople_lname.Enabled = true; } else { cmbchengename.Checked = false; txtpeoole_name.Enabled = false; txtpeople_lname.Enabled = false; } string tcode = dr["towncode_in"].ToString(); try { townnameManage_old.LoadProvinceToComboBox(cmbprovince_old, tcode); cmbprovince_old.SelectedValue = tcode.Substring(0, 2) + "0000"; townnameManage_old.LoadCityToComboBox(cmbdistrict_old, tcode.Substring(0, 2) + "0000", tcode.Substring(0, 4) + "00"); townnameManage_old.LoadTumbonToComboBox(cmbsub_district_old, tcode.Substring(0, 4) + "00", tcode); } catch { } if (!string.IsNullOrEmpty(dr["in_date"].ToString())) { dp_indate.Value = Convert.ToDateTime(dr["in_date"]); } txtrank.Text = dr["rank"].ToString(); txtbooknumber.Text = dr["book_number"].ToString(); if (dr["status"].ToString() == "1") { chkout.Checked = false; chkout.Enabled = true; lblstatus.Text = "ย้ายเข้า"; } if (dr["status"].ToString() == "2" || dr["status"].ToString() == "3" || dr["status"].ToString() == "4" || dr["status"].ToString() == "5") { DataControls.LoadComboBoxData(cmbselect_out, DataDefinition.Getstatusmore(), "status_name", "status_id", dr["status"].ToString()); chkout.Checked = true; chkout.Enabled = true; lblstatus.Text = DataControls.GetSelectedTextComboBoxToString(cmbselect_out); lblstatus.ForeColor = Color.Red; panel_out.Visible = true; if (dr["out_date"].ToString() != "1/1/0544 0:00:00" && !string.IsNullOrEmpty(dr["out_date"].ToString())) { dp_outdate.Value = Convert.ToDateTime(dr["out_date"]); } // txtaddress.Text = dr["address_out"].ToString(); txtaddress_mu.Text = dr["address_mu_out"].ToString(); txtaddress_soid.Text = dr["address_soid_out"].ToString(); txtaddress_road.Text = dr["address_road_out"].ToString(); DataControls.LoadComboBoxData(cmbselectaddress, DataDefinition.GetUnitmoreTab(), "unit_name", "unit_id", dr["type_out"].ToString()); tcode = dr["towncode_out"].ToString(); try { townnameManage.LoadProvinceToComboBox(cmbprovince, tcode); cmbprovince.SelectedValue = tcode.Substring(0, 2) + "0000"; townnameManage.LoadCityToComboBox(cmbdistrict, tcode.Substring(0, 2) + "0000", tcode.Substring(0, 4) + "00"); townnameManage.LoadTumbonToComboBox(cmbsub_district, tcode.Substring(0, 4) + "00", tcode); } catch { } } } } }