/// <summary> /// 查询日结记录 /// </summary> public void QueryBalanceRecorde() { // 返回值 int intReturn = 0; // 查询的起始时间 DateTime dtFrom = DateTime.MinValue; // 查询的截止时间 DateTime dtTo = DateTime.MinValue; // 返回的日志记录 ArrayList balanceRecord = new ArrayList(); // 返回的日志明细 ArrayList balanceDetail = new ArrayList(); // 查询的日记流水号 string sequence = ""; // 获取查询时间 intReturn = this.ucReprintDateTime.GetInputDateTime(ref dtFrom, ref dtTo); if (intReturn == -1) { return; } // 获取查询结果 intReturn = this.clinicDayBalance.GetBalanceRecord(this.currentOperator, dtFrom, dtTo, ref balanceRecord); if (intReturn == -1) { MessageBox.Show("获取日志记录失败"); return; } // 判断结果记录数,如果多条,那么弹出窗口让用户选择 if (balanceRecord.Count > 1) { frmConfirmBalanceRecord confirmBalanceRecord = new frmConfirmBalanceRecord(); confirmBalanceRecord.BalanceRecord = balanceRecord; if (confirmBalanceRecord.ShowDialog() == DialogResult.OK) { sequence = confirmBalanceRecord.fpSpread1.Sheets[0].Cells[confirmBalanceRecord.fpSpread1.Sheets[0].ActiveRowIndex, 0].Text; } else { return; } } else { foreach (NeuObject obj in balanceRecord) { sequence = obj.ID; } } // 根据日结序号获取日结明细 intReturn = this.clinicDayBalance.GetDayBalanceDetail(sequence, ref balanceDetail); if (intReturn == -1) { MessageBox.Show("获取日结明细失败!" + this.clinicDayBalance.Err); } // 设置FarPoint this.SetFarPoint(balanceDetail, this.ucReportReprint.fpSpread1_Sheet1); }
private void QueryDayBalanceRecord() { // 返回值 int intReturn = 0; // 查询的起始时间 DateTime dtFrom = DateTime.MinValue; // 查询的截止时间 DateTime dtTo = DateTime.MinValue; // 返回的日志记录 ArrayList balanceRecord = new ArrayList(); // 查询的日记流水号 string sequence = ""; //清除数据 int count = this.ucClinicDayBalanceReportNew2.neuSpread1_Sheet1.Rows.Count; if (count > 0) { this.ucClinicDayBalanceReportNew2.neuSpread1_Sheet1.Rows.Remove(0, count); } // 获取查询时间 intReturn = this.ucReprintDateControl1.GetInputDateTime(ref dtFrom, ref dtTo); if (intReturn == -1) { return; } // 获取查询结果 intReturn = this.clinicDayBalance.GetBalanceRecord(this.currentOperator, dtFrom, dtTo, ref balanceRecord); if (intReturn == -1) { MessageBox.Show("获取日志记录失败"); return; } string begin = string.Empty, end = string.Empty; // 判断结果记录数,如果多条,那么弹出窗口让用户选择 if (balanceRecord.Count > 1) { frmConfirmBalanceRecord confirmBalanceRecord = new frmConfirmBalanceRecord(); confirmBalanceRecord.BalanceRecord = balanceRecord; if (confirmBalanceRecord.ShowDialog() == DialogResult.OK) { sequence = confirmBalanceRecord.fpSpread1.Sheets[0].Cells[confirmBalanceRecord.fpSpread1.Sheets[0].ActiveRowIndex, 0].Text; begin = confirmBalanceRecord.fpSpread1.Sheets[0].Cells[confirmBalanceRecord.fpSpread1.Sheets[0].ActiveRowIndex, 1].Text; end = confirmBalanceRecord.fpSpread1.Sheets[0].Cells[confirmBalanceRecord.fpSpread1.Sheets[0].ActiveRowIndex, 2].Text; } else { return; } } else { foreach (NeuObject obj in balanceRecord) { sequence = obj.ID; begin = obj.Name; end = obj.Memo; } } //设置报表信息 this.SetInfo(begin, end, 1); //查找日结数据 DataSet ds = new DataSet(); intReturn = clinicDayBalance.GetDayBalanceRecord(sequence, ref ds); if (intReturn == -1) { MessageBox.Show(clinicDayBalance.Err); return; } if (ds.Tables.Count == 0 || ds == null || ds.Tables[0].Rows.Count == 0) { MessageBox.Show("该时间段内没有要查找的数据!"); return; } SetOldFarPointData(ds.Tables[0]); ds.Dispose(); }