private void button1_Click(object sender, EventArgs e) { string data03 = this.txtbs.Text.Trim(); string data04 = this.txtzs.Text.Trim(); string data05 = this.txtjg.Text.Trim(); string hosid = this.curHosID; string hosname = this.curHosName; string docid = this.curEmpID; string docName = this.curEmpName; string recordid = this._hrid; YunZhiService service = new YunZhiService(); YunZhiResult result = service.GetZhiHuiTuiSongData(data03, data04, data05, hosid, hosname, docid, docName, recordid); if (result.Result == 1) { string tuisongData = result.Msg; //解析推送消息就行显示在界面上 //调用清空 RunMethod(this.webBrowser1, "filllongtong", new string[] { tuisongData }); } else { MessageBox.Show(result.Msg, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
void _MainWork_DoWork(object sender, DoWorkEventArgs e) { YunZhiService service = null; try { service = new YunZhiService(); if (e.Argument != null) { string method = e.Argument.ToString(); switch (method.ToLower()) { case "getpartientlist": e.Result = new object[] { method.ToLower(), service.QueryProjectList(this._StartDate.ToString("yyyy-MM-dd 00:00:00"), this._EndDate.ToString("yyyy-MM-dd 23:59:59"), SourceHelper.EmployeeInfo.HID, this._patientName) }; break; case "getpatientinfo": e.Result = new object[] { method.ToLower(), service.GetProjectListAndPatientInfo(this._curEID, SourceHelper.EmployeeInfo.HID, this._StartDate.ToString("yyyy-MM-dd 00:00:00"), this._EndDate.ToString("yyyy-MM-dd 23:59:59")) }; break; } } } catch (Exception ex) { Logger.Log.Error("获取诊疗记录异常:" + ex.Message, ex); } finally { if (service != null) { service.Abort(); } } }
private void btnSave_Click(object sender, EventArgs e) { try { DataTable ddd = this.yaoPinDataTable.GetChanges(); string data03 = this.txtbs.Text.Trim(); string data04 = this.txtzs.Text.Trim(); string data05 = this.txtjg.Text.Trim(); string data06 = this.txtbz.Text.Trim(); if (string.IsNullOrEmpty(data04) == true) { MessageBox.Show("请输入主述信息!"); return; } if (string.IsNullOrEmpty(this._hrid) == true) { MessageBox.Show("请选择患者!"); return; } YunZhiResult res = new YunZhiService().UpdateRecorInfo(this._hrid, data03, data04, data05, data06, ddd, this._DelGuid.ToArray()); this._bgWork.RunWorkerAsync("getpatientinfo"); MessageBox.Show(res.Msg); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void SaveOption() { YunZhiService service = null; try { string userName = this.txtUserName.Text.Trim(); if (string.IsNullOrEmpty(userName)) { MessageBox.Show("请输入姓名!"); return; } string idcard = this.txt_IDCard.Text.Trim(); if (string.IsNullOrEmpty(idcard)) { //TODO Services MessageBox.Show("请输入身份证号!"); //不输入身份证号,服务端保存失败,返回的msg="" return; } string sex = this.cbBox_Sex.SelectedIndex.ToString(); DateTime birthday = this.dtp_Birthday.Value; string tel = this.txt_Tel.Text.Trim(); string address = this.txt_Address.Text.Trim(); string addressNew = this.txt_AddressNew.Text.Trim(); service = new YunZhiService(); YunZhiResult addResult = service.AddPatientInfo(userName, address, tel, birthday.ToString("yyyy-MM-dd hh:mm:ss"), sex, idcard, addressNew, SourceHelper.EmployeeInfo.HID, SourceHelper.EmployeeInfo.EmpID); if (addResult.Result == 1) { MessageBox.Show("添加成功"); this.DialogResult = DialogResult.OK; } else { string strMessgage = string.IsNullOrEmpty(addResult.Msg) ? "添加失败" : addResult.Msg; MessageBox.Show(strMessgage); } } catch (Exception ex) { Logger.Log.Error("添加异常:" + ex.Message, ex); } finally { if (service != null) { service.Abort(); } } }
private void btnOK_Click(object sender, EventArgs e) { try { string data03 = txt03.Text.Trim(); string data04 = txt04.Text.Trim(); string data05 = txt05.Text.Trim(); string data06 = txt06.Text.Trim(); YunZhiResult res = new YunZhiService().UpdateRecorInfo(this._HRID, data03, data04, data05, data06, null, null); MessageBox.Show(res.Msg); if (res.Result == 1) { this.DialogResult = DialogResult.OK; } } catch (Exception) { throw; } }
/// <summary> /// 异步开始调用服务 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void _bgWork_DoWork(object sender, DoWorkEventArgs e) { YunZhiService service = null; try { service = new YunZhiService(); if (e.Argument != null) { string method = e.Argument.ToString(); switch (method.ToLower()) { case "getrecordlist": e.Result = new object[] { method.ToLower(), service.GetHealthy_RecordListByDocId(SourceHelper.EmployeeInfo.EmpID) }; break; case "getpatientinfo": if (string.IsNullOrEmpty(this._patientID)) { e.Result = null; } else { e.Result = new object[] { method.ToLower(), service.GetZhenLiaoListByPTID(this._patientID, SourceHelper.EmployeeInfo.HID, this._hrid) }; } break; } } } catch (Exception ex) { Logger.Log.Error("获取诊疗记录异常:" + ex.Message, ex); } finally { if (service != null) { service.Abort(); } } }
private void toolMenuItemDel_Click(object sender, EventArgs e) { try { int count = this.treeView_Patient.Nodes.Count; if (count == 0) { MessageBox.Show("请选择要删除的档案!"); return; } if (MessageBox.Show("是否要删除", "删除提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) { TreeNode node = this.treeView_Patient.SelectedNode; if (node == null) { MessageBox.Show("请选择要删除的档案!"); return; } YZ_Health_Record curRecord = node.Tag as YZ_Health_Record; if (curRecord != null) { YunZhiResult res = new YunZhiService().DelHealthRecode(curRecord.HRID); MessageBox.Show(res.Msg); if (res.Result == 1) { this._bgWork.RunWorkerAsync("getrecordlist"); } } else { MessageBox.Show("请选择要删除的档案!"); } } } catch (Exception ex) { Logger.Log.Error("toolMenuItemDel_Click异常:" + ex.Message, ex); MessageBox.Show(ex.ToString()); } }
void _MainWork_DoWork(object sender, DoWorkEventArgs e) { YunZhiService service = null; try { service = new YunZhiService(); e.Result = service.GetZhenLiaoListByPTID(this._PID, this._HID, this._HRID); } catch (Exception ex) { Logger.Log.Error("获取诊疗详情错误:" + ex.Message, ex); } finally { if (service != null) { service.Abort(); } } }
void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { YunZhiService service = new YunZhiService(); try { YunZhiResult loginResult = service.UserLogin(this.TxtTel, this.TxtPwd); e.Result = loginResult; } catch (Exception ex) { Logger.Log.Error("登录异常:" + ex.Message, ex); } finally { if (service != null) { service.Abort(); } } }
void _mainBgWork_DoWork(object sender, DoWorkEventArgs e) { YunZhiService service = null; try { service = new YunZhiService(); YunZhiResult result = service.QueryZhenLiaoList(this._StartDate.ToString("yyyy-MM-dd 00:00:00"), this._EndDate.ToString("yyyy-MM-dd 23:59:59"), SourceHelper.EmployeeInfo.HID, this._PatientName); e.Result = result; } catch (Exception ex) { Logger.Log.Error("获取档案信息异常:" + ex.Message, ex); } finally { if (service != null) { service.Abort(); } } }
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); } }