public void InitEveryThing() { this.ChdStroke = new RecordsChdStrokeReportBLL().GetModel(PhysicalInfoFactory.ID); if (ChdStroke == null) { this.ChdStroke = new RecordsChdStrokeReportModel(); } this.bindingManager = new SimpleBindingManager <RecordsChdStrokeReportModel>(this.inputRanges, this.inputRange_str, this.ChdStroke); this.bindingManager.SimpleBinding(this.tbPatientNo, "PatientNo", false); this.bindingManager.SimpleBinding(this.tbADnum, "AdmissionNo", false); this.bindingManager.SimpleBinding(this.tbCardNum, "CardNo", false); this.bindingManager.SimpleBinding(this.tbICDnum, "ICD10Code", false); int age = Convert.ToInt32(DateTime.Now.ToString("yyyyMMdd")) - Convert.ToInt32(Convert.ToDateTime(Model.Birthday).ToString("yyyyMMdd")); if (age.ToString().Length == 6) { age = Convert.ToInt32(age.ToString().Substring(0, 2)); } else if (age.ToString().Length == 7) { age = Convert.ToInt32(age.ToString().Substring(0, 3)); } else if (age.ToString().Length == 5) { age = Convert.ToInt32(age.ToString().Substring(0, 1)); } else { age = 0; } this.tbAge.Text = age.ToString(); this.tbPhoneNum.Text = Model.Phone; if (string.IsNullOrEmpty(this.ChdStroke.AddDistrict) && !string.IsNullOrEmpty(Model.DistrictID.ToString())) { DataTable dtdistict = new RecordsDistrictBLL().GetList(string.Format("Code={0}", Model.DistrictID)).Tables[0]; if (dtdistict.Rows.Count > 0) { DataRow rowdistict = dtdistict.Rows[0]; this.tbAdddistrict.Text = rowdistict["Name"].ToString(); } } else { this.tbAdddistrict.Text = this.ChdStroke.AddDistrict; } if (string.IsNullOrEmpty(this.ChdStroke.AddTown) && !string.IsNullOrEmpty(Model.TownID.ToString())) { DataTable dtTown = new RecordsTownBLL().GetList(string.Format("Code={0}", Model.TownID)).Tables[0]; if (dtTown.Rows.Count > 0) { DataRow rowTown = dtTown.Rows[0]; this.tbAddtown.Text = rowTown["Name"].ToString(); } } else { this.tbAddtown.Text = this.ChdStroke.AddTown; } if (string.IsNullOrEmpty(this.ChdStroke.AddVillage) && !string.IsNullOrEmpty(Model.VillageID.ToString())) { DataTable dtVillage = new RecordsVillageBLL().GetList(string.Format("Code={0}", Model.VillageID)).Tables[0]; if (dtVillage.Rows.Count > 0) { DataRow rowVillage = dtVillage.Rows[0]; this.tbAddVillage.Text = rowVillage["Name"].ToString(); } } else { this.tbAddVillage.Text = this.ChdStroke.AddVillage; } if (string.IsNullOrEmpty(this.ChdStroke.HouesAddDistrict) && !string.IsNullOrEmpty(Model.DistrictID.ToString())) { DataTable dtdistict1 = new RecordsDistrictBLL().GetList(string.Format("Code={0}", Model.DistrictID)).Tables[0]; if (dtdistict1.Rows.Count > 0) { DataRow rowdistict1 = dtdistict1.Rows[0]; this.tbAdddistrict2.Text = rowdistict1["Name"].ToString(); } } else { this.tbAdddistrict2.Text = this.ChdStroke.HouesAddDistrict; } if (string.IsNullOrEmpty(this.ChdStroke.HouesAddTown) && !string.IsNullOrEmpty(Model.TownID.ToString())) { DataTable dtTown1 = new RecordsTownBLL().GetList(string.Format("Code={0}", Model.TownID)).Tables[0]; if (dtTown1.Rows.Count > 0) { DataRow rowTown1 = dtTown1.Rows[0]; this.tbAddtown2.Text = rowTown1["Name"].ToString(); } } else { this.tbAddtown2.Text = this.ChdStroke.HouesAddTown; } if (string.IsNullOrEmpty(this.ChdStroke.HouseAddVillage) && !string.IsNullOrEmpty(Model.VillageID.ToString())) { DataTable dtVillage1 = new RecordsVillageBLL().GetList(string.Format("Code={0}", Model.VillageID)).Tables[0]; if (dtVillage1.Rows.Count > 0) { DataRow rowVillage1 = dtVillage1.Rows[0]; this.tbAddVillage2.Text = rowVillage1["Name"].ToString(); } } else { this.tbAddVillage2.Text = this.ChdStroke.HouseAddVillage; } this.bindingManager.SimpleBinding(tbAddNum, "AddNum", false); this.bindingManager.SimpleBinding(tbAddNum2, "HouseAddNum", false); if (!string.IsNullOrEmpty(this.ChdStroke.AcuteMI)) { string guanxinb = this.ChdStroke.AcuteMI; foreach (string jb in guanxinb.Split(',')) { int nums; if (int.TryParse(jb, out nums)) { this.gxbzd[nums - 1].Checked = true; } } } if (!string.IsNullOrEmpty(this.ChdStroke.SAH)) { string naocuz = this.ChdStroke.SAH; foreach (string jb in naocuz.Split(',')) { int nums; if (int.TryParse(jb, out nums)) { this.nczzd[nums - 1].Checked = true; } } } if (!string.IsNullOrEmpty(this.ChdStroke.Diagnosis)) { string linchuanzd = this.ChdStroke.Diagnosis; foreach (string jb in linchuanzd.Split(',')) { int nums; if (int.TryParse(jb, out nums)) { this.zdyj[nums - 1].Checked = true; } } } if (this.ChdStroke.DiseaseTime.HasValue) { this.fabDate.Value = this.ChdStroke.DiagnosisTime.Value; } else { this.fabDate.Value = DateTime.Now; } if (this.ChdStroke.DiagnosisTime.HasValue) { this.quezDate.Value = this.ChdStroke.DiagnosisTime.Value; } else { this.quezDate.Value = DateTime.Now; } if (this.ChdStroke.FirstOnset == "1") { this.rbyes.Checked = true; } else if (this.ChdStroke.FirstOnset == "2") { this.rbNo.Checked = true; } else { this.rbyes.Checked = false; this.rbNo.Checked = false; } if (!string.IsNullOrEmpty(this.ChdStroke.ConfirmedUnit)) { switch (this.ChdStroke.ConfirmedUnit) { case "1": this.rdprovinceh.Checked = true; break; case "2": this.rdcityh.Checked = true; break; case "3": this.rddistircth.Checked = true; break; case "4": this.rdtownh.Checked = true; break; case "5": this.rdotherh.Checked = true; break; case "9": this.rdbuxingh.Checked = true; break; default: break; } } this.bindingManager.SimpleBinding(this.tbBkUnit, "CardUnit", false); this.bindingManager.SimpleBinding(this.tbBkdoctor, "CardDoctor", false); if (this.ChdStroke.CardDate.HasValue) { this.baokDate.Value = this.ChdStroke.CardDate.Value; } else { this.baokDate.Value = DateTime.Now; } if (this.ChdStroke.DeathDate.HasValue) { this.deathUC.txtTime.Text = Convert.ToDateTime(this.ChdStroke.DeathDate).ToLongDateString(); } this.bindingManager.SimpleBinding(this.tbReason, "DeathReason", false); this.bindingManager.SimpleBindingInt(this.tbDieNum, "DeathCode", true); this.EveryThingIsOk = true; }
public void InitEveryThing() { this.Tumors = new RecordsTumorBLL().GetModel(PhysicalInfoFactory.ID); if (this.Tumors == null) { this.Tumors = new RecordsTumorModel(); } this.bindingManager = new SimpleBindingManager <RecordsTumorModel>(this.inputRanges, this.inputRange_str, this.Tumors); this.bindingManager.SimpleBinding(this.tbNum, "RecordID", false); this.bindingManager.SimpleBinding(this.tbICD10num, "ICD", false); this.bindingManager.SimpleBinding(this.tbICD3num, "ICDO", false); this.bindingManager.SimpleBinding(this.tbZYnum, "HospitalizationID", false); this.bindingManager.SimpleBinding(this.tbMZnum, "ClinicID", false); if (Model.Birthday != null) { this.tbAge.Text = (DateTime.Now.Year - Model.Birthday.Value.Year).ToString(); } this.tbPhone.Text = Model.Phone; this.bindingManager.SimpleBindingInt(this.tbHealthCard, "MedicareCardID", true); this.bindingManager.SimpleBinding(this.tbOldZd, "OrigDiagnose", false); if (this.Tumors.OrigDiagnoseDate.HasValue) { this.dtpyzddate.Value = this.Tumors.OrigDiagnoseDate.Value; } else { this.dtpyzddate.Value = DateTime.Now; } if (string.IsNullOrEmpty(this.Tumors.HouseholtDistict) && !string.IsNullOrEmpty(Model.DistrictID.ToString())) { DataTable dtdistict = new RecordsDistrictBLL().GetList(string.Format("Code={0}", Model.DistrictID)).Tables[0]; if (dtdistict.Rows.Count > 0) { DataRow rowdistict = dtdistict.Rows[0]; this.tbAdddistrict.Text = rowdistict["Name"].ToString(); } } else { this.tbAdddistrict.Text = this.Tumors.HouseholtDistict; } if (string.IsNullOrEmpty(this.Tumors.HouseholtTown) && !string.IsNullOrEmpty(Model.TownID.ToString())) { DataTable dtTown = new RecordsTownBLL().GetList(string.Format("Code={0}", Model.TownID)).Tables[0]; if (dtTown.Rows.Count > 0) { DataRow rowTown = dtTown.Rows[0]; this.tbAddtown.Text = rowTown["Name"].ToString(); } } else { this.tbAddtown.Text = this.Tumors.HouseholtTown; } if (string.IsNullOrEmpty(this.Tumors.HouseholtVillage) && !string.IsNullOrEmpty(Model.VillageID.ToString())) { DataTable dtVillage = new RecordsVillageBLL().GetList(string.Format("Code={0}", Model.VillageID)).Tables[0]; if (dtVillage.Rows.Count > 0) { DataRow rowVillage = dtVillage.Rows[0]; this.tbAddvillage.Text = rowVillage["Name"].ToString(); } } else { this.tbAddvillage.Text = this.Tumors.HouseholtVillage; } if (string.IsNullOrEmpty(this.Tumors.PresentDistict) && !string.IsNullOrEmpty(Model.DistrictID.ToString())) { DataTable dtdistict1 = new RecordsDistrictBLL().GetList(string.Format("Code={0}", Model.DistrictID)).Tables[0]; if (dtdistict1.Rows.Count > 0) { DataRow rowdistict1 = dtdistict1.Rows[0]; this.tbAdddistrict2.Text = rowdistict1["Name"].ToString(); } } else { this.tbAdddistrict2.Text = this.Tumors.PresentDistict; } if (string.IsNullOrEmpty(this.Tumors.PresentTown) && !string.IsNullOrEmpty(Model.TownID.ToString())) { DataTable dtTown1 = new RecordsTownBLL().GetList(string.Format("Code={0}", Model.TownID)).Tables[0]; if (dtTown1.Rows.Count > 0) { DataRow rowTown1 = dtTown1.Rows[0]; this.tbAddtown2.Text = rowTown1["Name"].ToString(); } } else { this.tbAddtown2.Text = this.Tumors.PresentTown; } if (string.IsNullOrEmpty(this.Tumors.PresentVillage) && !string.IsNullOrEmpty(Model.VillageID.ToString())) { DataTable dtVillage1 = new RecordsVillageBLL().GetList(string.Format("Code={0}", Model.VillageID)).Tables[0]; if (dtVillage1.Rows.Count > 0) { DataRow rowVillage1 = dtVillage1.Rows[0]; this.tbAddvillage2.Text = rowVillage1["Name"].ToString(); } } else { this.tbAddvillage2.Text = this.Tumors.PresentVillage; } this.bindingManager.SimpleBinding(this.tbAddNum, "HouseholtNum", false); this.bindingManager.SimpleBinding(this.tbAddNum2, "PresentNum", false); this.bindingManager.SimpleBinding(this.tbZD, "Diagnose", false); this.bindingManager.SimpleBinding(this.tbType, "PathologyType", false); this.bindingManager.SimpleBinding(this.tbLocation, "PrimaryParts", false); this.bindingManager.SimpleBinding(this.tbTNMt, "StageT", false); this.bindingManager.SimpleBinding(this.tbTNMn, "StageN", false); this.bindingManager.SimpleBinding(this.tbTNMm, "StageM", false); if (this.Tumors.DiagnoseDate.HasValue) { this.dtpzddate.Value = this.Tumors.DiagnoseDate.Value; } else { this.dtpzddate.Value = DateTime.Now; } this.bindingManager.SimpleBinding(this.tbUnit, "ReportsUnit", false); this.bindingManager.SimpleBinding(this.tbDoctor, "ReportsDoctor", false); if (this.Tumors.ReportDate.HasValue) { this.dtReportDate.Value = this.Tumors.ReportDate.Value; } else { this.dtReportDate.Value = DateTime.Now; } if (this.Tumors.DieDate.HasValue) { this.dieUC.txtTime.Text = this.Tumors.DieDate.Value.ToLongDateString(); } this.bindingManager.SimpleBinding(this.tbDieReason, "DieReason", false); if (!string.IsNullOrEmpty(this.Tumors.Judgment)) { string zhendyj = this.Tumors.Judgment; foreach (string zd in zhendyj.Split(',')) { int nums; if (int.TryParse(zd, out nums)) { this.zdyjs[nums - 1].Checked = true; } } } this.EveryThingIsOk = true; }