private void SaveFamBedHistory() { RecordsFamilyBedHistoryBLL recordsFamilyBedHistoryBLL = new RecordsFamilyBedHistoryBLL(); recordsFamilyBedHistoryBLL.DeleteByOutKey(PhysicalInfoFactory.ID); foreach (RecordsFamilyBedHistoryModel recordsFamilyBedHistoryModel in this.FamilyBedHistoryInfo) { if (recordsFamilyBedHistoryModel.ModelState != RecordsStateModel.DeleteInDB) { recordsFamilyBedHistoryModel.OutKey = PhysicalInfoFactory.ID; recordsFamilyBedHistoryBLL.Add(recordsFamilyBedHistoryModel); } } }
private void MustChoose() { DataView dv = dsRequire.Tables[0].DefaultView; dv.RowFilter = "IsRequired='1' "; DataTable dt = dv.ToTable(); List <RecordsHospitalHistoryModel> HospitalHistoryTemp = new RecordsHospitalHistoryBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, PhysicalInfoFactory.ID)); List <RecordsFamilyBedHistoryModel> FamilyBedHistoryInfoTemp = new RecordsFamilyBedHistoryBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, PhysicalInfoFactory.ID)); List <RecordsMedicationModel> MedicationTem = new RecordsMedicationBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, PhysicalInfoFactory.ID)); foreach (DataRow item in dt.Rows) { if (item["Isrequired"].ToString() == "1") { switch (item["ChinName"].ToString()) { case "住院史": if (HospitalHistoryTemp == null || HospitalHistoryTemp.Count == 0) { this.groupBox33.Text = "*住院史"; this.groupBox33.ForeColor = System.Drawing.Color.Red; } else { this.groupBox33.Text = "住院史"; this.groupBox33.ForeColor = System.Drawing.Color.Black; } break; case "家庭病床史": if (FamilyBedHistoryInfoTemp == null || FamilyBedHistoryInfoTemp.Count == 0) { this.groupBox35.Text = "*家庭病床史"; this.groupBox35.ForeColor = System.Drawing.Color.Red; } else { this.groupBox35.Text = "家庭病床史"; this.groupBox35.ForeColor = System.Drawing.Color.Black; } break; case "用药情况": if (MedicationTem == null || MedicationTem.Count == 0) { this.groupBox9.Text = "*用药情况"; this.groupBox9.ForeColor = System.Drawing.Color.Red; } else { this.groupBox9.Text = "用药情况"; this.groupBox9.ForeColor = System.Drawing.Color.Black; } break; default: break; } } } }
//默认项设置 private void PresetValue() { DataView dv = dsRequire.Tables[0].DefaultView; dv.RowFilter = " IsSetValue='是' or IsSetValue='预设上次体检' "; DataTable dt = dv.ToTable(); RecordsCustomerBaseInfoModel CustomerBaseInfos = new RecordsCustomerBaseInfoBLL().GetMaxModel(this.Model.IDCardNo);//获取最新一笔体检数据 List <RecordsHospitalHistoryModel> HospitalHistoryTemp = new List <RecordsHospitalHistoryModel>(); List <RecordsFamilyBedHistoryModel> FamilyBedHistoryInfoTemp = new List <RecordsFamilyBedHistoryModel>(); List <RecordsMedicationModel> MedicationTemp = new List <RecordsMedicationModel>(); if (CustomerBaseInfos != null) { HospitalHistoryTemp = new RecordsHospitalHistoryBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, CustomerBaseInfos.ID)); FamilyBedHistoryInfoTemp = new RecordsFamilyBedHistoryBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, CustomerBaseInfos.ID)); MedicationTemp = new RecordsMedicationBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, CustomerBaseInfos.ID)); } foreach (DataRow item in dt.Rows) { switch (item["ChinName"].ToString()) { case "住院史": if (item["IsSetValue"].ToString() == "是") { if (!string.IsNullOrEmpty(item["ItemValue"].ToString())) { string[] reslist = item["ItemValue"].ToString().Split(';'); RecordsHospitalHistoryModel hModel = new RecordsHospitalHistoryModel(); hModel.InHospitalDate = Convert.ToDateTime(reslist[0].ToString()); hModel.OutHospitalDate = Convert.ToDateTime(reslist[1].ToString()); hModel.Reason = reslist[2].ToString(); hModel.HospitalName = reslist[3].ToString(); hModel.IllcaseNum = reslist[4].ToString(); this.HospitalHistory.Add(hModel); } } else { this.HospitalHistory = HospitalHistoryTemp; } break; case "家庭病床史": if (item["IsSetValue"].ToString() == "预设上次体检") { this.FamilyBedHistoryInfo = FamilyBedHistoryInfoTemp; } break; case "用药情况": if (item["IsSetValue"].ToString() == "预设上次体检" && !community.Equals("平度云山医院")) { this.Medication = MedicationTemp; } break; default: break; } } }