/// <summary> /// 按发票号检索发票基本信息 /// </summary> public int QueryInvoiceInfromationByInvoiceNo() { // 变量定义 int intReturn = 0; string strCode = ""; System.Data.DataSet dsResult1 = new DataSet(); System.Data.DataSet dsResult2 = new DataSet(); System.Data.DataSet dsResult3 = new DataSet(); Neusoft.HISFC.BizLogic.Fee.Outpatient outpatient = new Neusoft.HISFC.BizLogic.Fee.Outpatient(); // 获取检索码 intReturn = this.GetInput(ref strCode); if (intReturn == -1) { this.frmWait.Hide(); return(-1); } // 执行查询 intReturn = outpatient.QueryBalancesByInvoiceNO(strCode, ref dsResult1); if (-1 == intReturn) { MessageBox.Show("获取发票基本信息失败" + outpatient.Err); this.frmWait.Hide(); return(-1); } this.fpSpread1_Sheet1.DataSource = dsResult1; // 按发票号查询同时查询发票明细和费用明细 intReturn = outpatient.QueryBalanceListsByInvoiceNO(strCode, ref dsResult2); if (-1 == intReturn) { MessageBox.Show("获取发票明细失败" + outpatient.Err); this.frmWait.Hide(); return(-1); } this.fpSpread1_Sheet2.DataSource = dsResult2; intReturn = outpatient.QueryFeeItemListsByInvoiceNO(strCode, ref dsResult3); if (-1 == intReturn) { MessageBox.Show("获取费用明细失败" + outpatient.Err); this.frmWait.Hide(); return(-1); } this.fpSpread1_Sheet3.DataSource = dsResult3; if (this.fpSpread1_Sheet3.RowCount > 0) { this.SetSheet3DisplayData(); } return(1); }
/// <summary> /// 双击表格第一页,根据发票号查询发票明细和费用明细 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void fpSpread1_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e) { if (this.fpSpread1.ActiveSheet == this.fpSpread1_Sheet1) { if (this.fpSpread1_Sheet1.RowCount > 0) { this.frmWait.Show(); // 返回值 int intReturn = 0; // 声明变量 = 所选行的发票号 string strCode = this.fpSpread1_Sheet1.Cells[e.Row, 0].Text; // 返回的数据源 System.Data.DataSet dsResult1 = new DataSet(); System.Data.DataSet dsResult2 = new DataSet(); // 业务层 Neusoft.HISFC.BizLogic.Fee.Outpatient outpatient = new Neusoft.HISFC.BizLogic.Fee.Outpatient(); // 查询患者发票明细 intReturn = outpatient.QueryBalanceListsByInvoiceNO(strCode, ref dsResult1); if (-1 == intReturn) { this.frmWait.Hide(); MessageBox.Show("获取发票明细失败" + outpatient.Err); return; } this.fpSpread1_Sheet2.DataSource = dsResult1; this.fpSpread1.ActiveSheet = this.fpSpread1_Sheet2; // 查询患者费用明细 intReturn = outpatient.QueryFeeItemListsByInvoiceNO(strCode, ref dsResult2); if (-1 == intReturn) { this.frmWait.Hide(); MessageBox.Show("获取费用明细失败" + outpatient.Err); return; } this.fpSpread1_Sheet3.DataSource = dsResult2; if (this.fpSpread1_Sheet3.RowCount > 0) { this.SetSheet3DisplayData(); } this.frmWait.Hide(); } } }