/// <summary> /// 设置基本信息 /// </summary> /// <param name="source"></param> private void SetJiBenAndProjectInfo(DataTable[] sourceList) { if (sourceList == null || sourceList.Length == 0) { this.lblName.Text = ""; this.label4.Text = ""; this.label5.Text = ""; this.label6.Text = ""; return; } try { DataTable source = sourceList[0]; List <YZ_Patients> patientList = new ModelHandler <YZ_Patients>().TableToList(source); if (patientList != null && patientList.Count > 0) { YZ_Patients patinetModel = patientList[0]; this.lblName.Text = string.Format("姓名:{0}", patinetModel.PTName); this.label4.Text = string.Format("性别:{0}", patinetModel.PTSex == "0" ? "男" : "女"); this.label5.Text = string.Format("联系方式:{0}", patinetModel.PTTelPhone); this.label6.Text = string.Format("家庭住址:{0}", patinetModel.PTAddress); } DataTable projectSource = sourceList[1]; List <YZ_Project> projectList = new ModelHandler <YZ_Project>().TableToList(projectSource); this.SetKuaiJianResult(projectList); } catch (Exception ex) { Logger.Log.Error("SetJiBenAndProjectInfo异常:" + ex.Message, ex); MessageBox.Show(ex.ToString()); } }
/// <summary> /// 设置基本信息 /// </summary> /// <param name="source"></param> private void SetJiBenAndProjectInfo(DataTable[] sourceList) { if (sourceList == null || sourceList.Length == 0) { return; } try { DataTable source = sourceList[0]; List <YZ_Patients> patientList = new ModelHandler <YZ_Patients>().TableToList(source); if (patientList != null && patientList.Count > 0) { YZ_Patients patinetModel = patientList[0]; this.label2.Text = string.Format("姓名:{0}", patinetModel.PTName); this.label3.Text = string.Format("性别:{0}", patinetModel.PTSex == "0" ? "男" : "女"); this.label4.Text = string.Format("出生日期:{0}", string.IsNullOrEmpty(patinetModel.PTBrithday) == true ? "" : Convert.ToDateTime(patinetModel.PTBrithday).ToString("yyyy-MM-dd")); this.label5.Text = string.Format("联系方式:{0}", patinetModel.PTTelPhone); this.label6.Text = string.Format("家庭住址:{0}", patinetModel.PTAddress); this.label7.Text = string.Format("现住址:{0}", patinetModel.PTRemark); //调用清空 if (this.treeView_Patient.Nodes != null && this.treeView_Patient.Nodes.Count > 0) { RunMethod(this.webBrowser1, "clearHtml", new string[] { "" }); } } DataTable projectSource = sourceList[1]; List <YZ_Project> projectList = new ModelHandler <YZ_Project>().TableToList(projectSource); this.SetKuaiJianResult(projectList); List <YZ_Health_Record> recordList = new ModelHandler <YZ_Health_Record>().TableToList(sourceList[2]); if (recordList != null && recordList.Count > 0) { this.SetWenZhenInfo(recordList[0]); } this.yaoPinDataTable = sourceList[3]; this.dataGridView1.DataSource = this.yaoPinDataTable; _DelGuid = new List <string>(); } catch (Exception ex) { Logger.Log.Error("SetJiBenAndProjectInfo异常:" + ex.Message, ex); MessageBox.Show(ex.ToString()); } }
private void btnPrint_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(this._hrid) == true) { MessageBox.Show("请选择患者!"); return; } YunZhiService service = new YunZhiService(); try { if (System.IO.File.Exists(GetPath() + "chufang.frx") == false) { MessageBox.Show("未找到处方打印模板!"); return; } YunZhiResult res = service.GetZhenLiaoListByPTID(this._patientID, SourceHelper.EmployeeInfo.HID, this._hrid); if (res.Result == 0) { MessageBox.Show(res.Msg); return; } DataTable[] sourceList = res.DataList; //获取当前信息,然后打印 if (sourceList == null || sourceList.Length == 0) { return; } List <PrintModel> printList = new List <PrintModel>(); PrintModel model = new PrintModel(); DataTable source = sourceList[0]; List <YZ_Patients> patientList = new ModelHandler <YZ_Patients>().TableToList(source); if (patientList != null && patientList.Count > 0) { YZ_Patients patinetModel = patientList[0]; model.PTName = patinetModel.PTName; if (string.IsNullOrEmpty(patinetModel.PTBrithday) == false) { DateTime curTime = Convert.ToDateTime(patinetModel.PTBrithday); DateTime now = DateTime.Today; int age = now.Year - curTime.Year; if (curTime > now.AddYears(-age)) { age--; } model.PTNianLing = age.ToString(); } model.PTSex = patinetModel.PTSex == "0" ? "男" : "女"; } DataTable projectSource = sourceList[1]; List <YZ_Project> projectList = new ModelHandler <YZ_Project>().TableToList(projectSource); this.SetKuaiJianResult(projectList); List <YZ_Health_Record> recordList = new ModelHandler <YZ_Health_Record>().TableToList(sourceList[2]); if (recordList != null && recordList.Count > 0) { model.ZhenDuan = recordList[0].Data05; model.ZhuShu = recordList[0].Data04; } model.HosName = this.curHosName; if (sourceList[3] != null && sourceList[3].Rows != null && sourceList[3].Rows.Count > 0) { foreach (DataRow row in sourceList[3].Rows) { model.YaoPinList.Add(new YaoPinModel() { YaoPinName = row["DrugName"].ToString(), YongFa = row["DrugYF"].ToString(), YongLiang = row["DrugYL"].ToString() }); } printList.Add(model); } Report report = new Report(); report.Load(GetPath() + "chufang.frx"); report.RegisterData(printList, "CFDS"); report.Prepare(); report.ShowPrepared(); report.Dispose(); } catch (Exception ex) { Logger.Log.Error("SetJiBenAndProjectInfo异常:" + ex.Message, ex); MessageBox.Show(ex.ToString()); } } catch (Exception ex) { MessageBox.Show(ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void SetValue(DataTable[] sourceList) { if (sourceList == null || sourceList.Length == 0) { return; } try { DataTable source = sourceList[0]; List <YZ_Patients> patientList = new ModelHandler <YZ_Patients>().TableToList(source); if (patientList != null && patientList.Count > 0) { YZ_Patients patinetModel = patientList[0]; this.lbl_Name.Text = patinetModel.PTName; this.lbl_Sex.Text = patinetModel.PTSex == "0" ? "男" : "女"; this.lbl_Birthday.Text = string.IsNullOrEmpty(patinetModel.PTBrithday) == true ? "" : Convert.ToDateTime(patinetModel.PTBrithday).ToString("yyyy-MM-dd"); this.lbl_Tel.Text = patinetModel.PTTelPhone; this.lbl_Address.Text = patinetModel.PTAddress; this.lbl_Remark.Text = patinetModel.PTRemark; this.lbl_IDCard.Text = patinetModel.PTIDNumber; } this.dataGridView1.DataSource = sourceList[1]; List <YZ_Health_Record> recordList = new ModelHandler <YZ_Health_Record>().TableToList(sourceList[2]); if (recordList != null && recordList.Count > 0) { YZ_Health_Record curModel = recordList[0]; if (string.IsNullOrEmpty(curModel.Data04) == true) { this.label12.Text = ""; } else { this.label12.Text = curModel.Data04.Replace("\n", ""); } if (string.IsNullOrEmpty(curModel.Data03) == true) { this.label13.Text = ""; } else { this.label13.Text = curModel.Data03.Replace("\n", ""); } if (string.IsNullOrEmpty(curModel.Data05) == true) { this.label14.Text = ""; } else { this.label14.Text = curModel.Data05.Replace("\n", ""); } if (string.IsNullOrEmpty(curModel.Data06) == true) { this.label15.Text = ""; } else { this.label15.Text = curModel.Data06.Replace("\n", ""); } } } catch (Exception ex) { Logger.Log.Error("SetJiBenAndProjectInfo异常:" + ex.Message, ex); MessageBox.Show(ex.ToString()); } }
public virtual void GetNewsList(HttpContext contex) { string code = "0"; string msg = ""; try { ArrayList alllist = new ArrayList(); string ptId = Guid.NewGuid().ToString("N"); //患者ID string ptName = context.Request["PTName"].ToString(); //患者姓名 string ptAddress = context.Request["PTAddress"].ToString(); //家庭住址 string ptBrithDay = context.Request["PTBrithday"].ToString(); //生日 string ptSex = context.Request["PTSex"].ToString(); //性别 string ptIDNumber = context.Request["PTIDNumber"].ToString(); //身份证号 string ptRemark = context.Request["PTRemark"].ToString(); //备注 string hrID = Guid.NewGuid().ToString("N"); // 就诊ID string EID = context.Request["EID"].ToString(); //医生账号ID string HID = context.Request["HID"].ToString(); //医疗设备ID string hrRemark = context.Request["HRRemark"].ToString(); //备注 string hdID = Guid.NewGuid().ToString("N"); // 就诊详情ID string proID = context.Request["ProID"].ToString(); //项目ID string hdRemark = context.Request["HDRemark"].ToString(); //备注 string connectionString = ConfigurationManager.ConnectionStrings["YZConnString"].ConnectionString; var dbFactory = new OrmLiteConnectionFactory(connectionString, SqlServerDialect.Provider); using (var db = dbFactory.Open()) { //患者信息 YZ_Patients yzpModel = new YZ_Patients(); yzpModel.PTID = ptId; yzpModel.PTName = ptName; yzpModel.PTAddress = ptAddress; yzpModel.PTBrithday = ptBrithDay; yzpModel.PTSex = ptSex; yzpModel.PTIDNumber = ptIDNumber; yzpModel.PTRemark = ptRemark; yzpModel.PTCreated = DateTime.Now; yzpModel.IsEnable = true; db.Insert(yzpModel); //就诊 YZ_Health_Record yzhr = new YZ_Health_Record(); yzhr.HRID = hrID; yzhr.HID = HID; yzhr.EID = EID; yzhr.PTID = ptId; yzhr.HRCreated = DateTime.Now; yzhr.HRRemark = hrRemark; yzhr.IsEnable = true; db.Insert(yzhr); //就诊详情 YZ_Health_Detail yzhd = new YZ_Health_Detail(); yzhd.HDID = hdID; yzhd.HRID = hrID; yzhd.ProID = proID; yzhd.HDCreated = DateTime.Now; yzhd.HDRemark = hdRemark; db.Insert(yzhd); code = "1"; msg = "新增成功."; } EmployeeList el = new EmployeeList(); el.Emp_Code = "test"; el.Emp_Name = "test"; alllist.Add(el); //string strJson = Newtonsoft.Json.JsonConvert.SerializeObject(alllist); //contex.Response.Write(strJson); } catch (Exception ex) { code = "0"; msg = ex.Message; Logger.Log.Error(ex.Message, ex); } string strJson = UserHelper.RequestJsonP("{\"code\":\"" + code + "\",\"msg\":\"" + msg + "\"}"); context.Response.Write(strJson); }