//绑定病人列表 private void BindLvPatList() { string DeptCode = null; string CureNo = null; string PatName = null; DateTime?Bdate = null; DateTime?Edate = null; bool IsIn = true; if (this.chbDept.Checked) { DeptCode = this.cbDept.SelectedValue.ToString().Trim(); } if (this.checkBox3.Checked) { CureNo = this.tbInpatNo.Text; } if (this.checkBox4.Checked) { PatName = this.textBox1.Text.Trim(); } if (this.checkBox2.Checked) { Bdate = this.dtpBdate.Value; Edate = this.dtpEdate.Value; } IsIn = this.cb_pattype.SelectedIndex == 0 ? true : false; this.lvPatList.Items.Clear(); List <ZY_PatList> zypatlist = null; //ZY_PatList zy_Patlist = new ZY_PatList(); BindPatListVal bplv = new BindPatListVal(); bplv.IsIn = IsIn; bplv.DeptCode = DeptCode; bplv.Bdate = Bdate; bplv.Edate = Edate; bplv.CureNo = CureNo; bplv.PatName = PatName; bplv.IsCost = this.cb_pattype.SelectedIndex == 1 ? true : false; zy_PatList.bindPatListVal = bplv; zy_PatList.bindPatListType = BindPatListType.费用清单病人列表; zypatlist = zy_PatList.BindPatList(); if (zypatlist.Count == 0) { MessageBox.Show("未找到任何病人!"); return; } IcostManager icM = ObjectFactory.GetObject <IcostManager>(typeof(ZY_CostMaster)); for (int i = 0; i < zypatlist.Count; i++) { bool b = true;//false 欠费病人 ListViewItem lstViewItem = new ListViewItem(); lstViewItem.SubItems.Clear(); lstViewItem.Tag = zypatlist[i]; lstViewItem.SubItems[0].Text = zypatlist[i].CureNo; lstViewItem.SubItems.Add(zypatlist[i].BedCode); lstViewItem.SubItems.Add(zypatlist[i].patientInfo.PatName); lstViewItem.SubItems.Add(zypatlist[i].patientInfo.PatSex); if (zypatlist[i].PatType == "4" || zypatlist[i].PatType == "5") { icM = icM.GetCostMaster(zypatlist[i].PatListID); lstViewItem.SubItems.Add(icM.Deptosit_Fee.ToString()); lstViewItem.SubItems.Add(icM.Total_Fee.ToString());//HIS.ZY_BLL.OP_CostManage.GetSumVillage_Fee(zypatlist[i].PatListID).ToString("0.00")); lstViewItem.SubItems.Add(Convert.ToString(icM.Deptosit_Fee - icM.Total_Fee)); } else { icM.PatListID = zypatlist[i].PatListID; PatFee patFee = icM.GetPatFee(); lstViewItem.SubItems.Add(patFee.chargeFee.ToString()); lstViewItem.SubItems.Add(patFee.costFee.ToString()); lstViewItem.SubItems.Add(patFee.surplusFee.ToString()); if (patFee.surplusFee < 0) { b = false;//欠费病人 } } lstViewItem.SubItems.Add(zypatlist[i].patientInfo.PatBriDate.ToString("yyyy-MM-dd")); lstViewItem.SubItems.Add(BaseNameFactory.GetName(baseNameType.科室名称, zypatlist[i].CurrDeptCode)); lstViewItem.SubItems.Add(zypatlist[i].patientInfo.ACCOUNTTYPE); lstViewItem.SubItems.Add(zypatlist[i].CureDate.Date.ToString("yyyy-MM-dd")); string strOutDate = zypatlist[i].OutDate.Date.ToString("yyyy-MM-dd"); strOutDate = strOutDate == "0001-01-01" ? "至今" : strOutDate; lstViewItem.SubItems.Add(strOutDate); if (zypatlist[i].OutDate.ToString("yyyy-MM-dd") == "0001-01-01") { //this.tbNum.Text = ts.Days.ToString(); lstViewItem.SubItems.Add("0"); } else { TimeSpan ts = zypatlist[i].OutDate - zypatlist[i].CureDate; lstViewItem.SubItems.Add(ts.Days.ToString()); } //[20100624.1.10] if (this.cbQF.Checked == true)//欠费病人显示 { if (b == false) { this.lvPatList.Items.Add(lstViewItem); } } else { this.lvPatList.Items.Add(lstViewItem); } } }
//打印主功能 private void PrintMain(bool IsPreview, string presdeptcode) { Report = new grproLib.GridppReport(); IcostManager icM = ObjectFactory.GetObject <IcostManager>(typeof(ZY_CostMaster)); icM.PatListID = zy_pat.PatListID; PatFee patFee = icM.GetPatFee(this.dtpE.Value.Date); if (this.radioButton1.Checked) { Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用清单_汇总.grf"); } else if (this.radioButton2.Checked) { Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用清单_核算.grf"); } else if (this.radioButton3.Checked) { Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用清单.grf"); } else if (this.radioButton4.Checked) { Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用清单_汇总分组.grf"); } else if (this.radioButton5.Checked) { Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用一日清单.grf"); } if (checkBox1.Checked == true) { Report.ParameterByName("费用时间").AsString = this.dtpB.Value.ToString("yyyy-MM-dd HH:mm:ss") + "至" + this.dtpE.Value.ToString("yyyy-MM-dd HH:mm:ss"); } else { string date1, date2; if (zy_pat.OutDate.Date.ToString("yyyy-MM-dd") == "0001-01-01") { date2 = "至今"; } else { date2 = zy_pat.OutDate.Date.ToString("yyyy-MM-dd") + " 23:59:59"; } date1 = zy_pat.CureDate.ToString("yyyy-MM-dd HH:mm:ss"); Report.ParameterByName("费用时间").AsString = date1 + "至" + date2; } if (this.radioButton5.Checked) { Report.ParameterByName("费用时间").AsString = this.dtpB.Value.ToString("yyyy-MM-dd HH:mm:ss"); } Report.ParameterByName("CureNo").AsString = zy_pat.CureNo; Report.ParameterByName("PatCaseNo").AsString = zy_pat.patientInfo.PatCaseNo; Report.ParameterByName("PatName").AsString = zy_pat.patientInfo.PatName; string DateStr = zy_pat.OutDate.Date.ToString("yyyy-MM-dd"); if (DateStr == "0001-01-01") { DateStr = zy_pat.CureDate.Date.ToString("yyyy-MM-dd"); } else { DateStr = zy_pat.CureDate.Date.ToString("yyyy-MM-dd") + "至" + DateStr; } Report.ParameterByName("MarkDate").AsString = DateStr; Report.ParameterByName("BedCode").AsString = zy_pat.BedCode; if (presdeptcode == null) { Report.ParameterByName("住院科室").AsString = BaseNameFactory.GetName(baseNameType.科室名称, zy_pat.CurrDeptCode); } else { Report.ParameterByName("住院科室").AsString = BaseNameFactory.GetName(baseNameType.科室名称, presdeptcode); } Report.ParameterByName("WorkName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName; if (zy_pat.PatType == "4" || zy_pat.PatType == "5") { //Report.ParameterByName("累计交费").AsString = "0"; //try //{ // ZY_CostMaster zyCM = new ZY_CostMaster(); // Report.ParameterByName("农合医保记账").AsString = zyCM.GetSumVillage_Fee(zy_pat.PatListID).ToString("0.00"); //} //catch { } //Report.ParameterByName("余额").AsString = "0"; icM = icM.GetCostMaster(zy_pat.PatListID); Report.ParameterByName("累计交费").AsString = icM.Deptosit_Fee.ToString(); Report.ParameterByName("累计记账").AsString = icM.Total_Fee.ToString(); Report.ParameterByName("余额").AsString = Convert.ToString(icM.Deptosit_Fee - icM.Total_Fee); } else { Report.ParameterByName("累计交费").AsString = patFee.chargeFee.ToString(); Report.ParameterByName("累计记账").AsString = patFee.costFee.ToString(); Report.ParameterByName("余额").AsString = patFee.surplusFee.ToString(); } //ShowItemData(); 移动在Print()中 try { Report.ParameterByName("甲类总金额").AsString = firstFee.ToString(); Report.ParameterByName("乙类总金额").AsString = secondFee.ToString(); Report.ParameterByName("本次优惠").AsString = AllDec.ToString(); Report.ParameterByName("担保金额").AsString = zy_pat.DbFee.ToString("0.00"); //Report.ParameterByName("自付金额").AsString = Convert.ToString(patFee.costFee - firstFee - secondFee); } catch { } if (this.radioButton5.Checked) { for (int i = 0; i < ItemDt.Rows.Count; i++) { for (int j = 1; j <= Report.Parameters.Count; j++) { if (ItemDt.Rows[i]["itemname"].ToString().Trim() == Report.Parameters[j].Name) { Report.Parameters[j].Value = ItemDt.Rows[i]["Tolal_Fee"].ToString(); } } } } else { Report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(Report_FetchRecord); } if (IsPreview) { Report.PrintPreview(false); } else { Report.Print(false); } }