private void btnStat_Click(object sender, EventArgs e) { try { Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor(); btnStat.Enabled = false; btnPrint.Enabled = false; btnClose.Enabled = false; DateTime beginDate; DateTime endDate; string accountIdList; ReportController.GetReportBeginDateAndEndDate(StatDateType.交账时间, 25, dtpFrom.Value, dtpEnd.Value, out beginDate, out endDate, out accountIdList); BaseReport report = new DoctorIncomeReport(); report.BeginDate = beginDate; report.EndDate = endDate; report.StatType = StatClassType.门诊会计分类; report.Reportstyle = ReportStyle.科目为明细行; report.StatDateType = StatDateType.交账时间; report.AccountIdList = accountIdList; report.StatObjectType = StatObjctType.医生; report.ReportTitle = ""; report.Lister = PublicDataReader.GetEmployeeNameById(currentEmployeeId); ReportController.FillReport(report); dgvReport.DataSource = report.DataResult; dgvReport.Tag = report; for (int i = 1; i < dgvReport.Columns.Count; i++) { dgvReport.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; dgvReport.Columns[i].Width = 80; } dgvReport.Columns[0].Frozen = true; dgvReport.Columns[1].Frozen = true; //第二部分 ShowTotalInfo(); } catch (Exception err) { MessageBox.Show(err.Message); } finally { Cursor = Cursors.Default; btnStat.Enabled = true; btnPrint.Enabled = true; btnClose.Enabled = true; } }
private void btnStat_Click(object sender, EventArgs e) { DateTime beginDate; DateTime endDate; BaseReport report = null; string accountIdList; StatDateType dateType = StatDateType.自然时间; StatClassType statType = StatClassType.门诊发票分类; StatObjctType statObjectType = StatObjctType.医生; ReportStyle style = ReportStyle.科目为标题列; #region 统计条件 foreach (object obj in Enum.GetValues(typeof(StatClassType))) { if (obj.ToString( ) == cboStatType.Text) { statType = (StatClassType)obj; break; } } foreach (object obj in Enum.GetValues(typeof(StatObjctType))) { if (obj.ToString( ) == cboType.Text) { statObjectType = (StatObjctType)obj; break; } } #endregion try { Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor( ); SetButtonEnable(false); ReportController.GetReportBeginDateAndEndDate(dateType, 0, dtpFrom.Value, dtpEnd.Value, out beginDate, out endDate, out accountIdList); lblDate.Text = beginDate.ToString("yyyy-MM-dd HH:mm:ss") + " —— " + endDate.ToString("yyyy-MM-dd HH:mm:ss"); switch (statObjectType) { case StatObjctType.医生: report = new DoctorIncomeReport( ); break; case StatObjctType.科室: report = new DepartmentIncomeReport( ); break; case StatObjctType.收费员: report = new TollerIncomeReport( ); break; case StatObjctType.病人类型: report = new PatientTypeIncomReport( ); break; } report.BeginDate = beginDate; report.EndDate = endDate; report.StatType = statType; report.Reportstyle = style; report.StatDateType = dateType; report.AccountIdList = accountIdList; report.StatObjectType = statObjectType; report.ReportTitle = "门诊" + cboType.Text + "收入报表"; report.Lister = PublicDataReader.GetEmployeeNameById(currentEmployeeId); ReportController.FillReport(report); dgvReport.DataSource = report.DataResult; dgvReport.Tag = report; for (int i = 1; i < dgvReport.Columns.Count; i++) { dgvReport.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; dgvReport.Columns[i].Width = 80; } dgvReport.Columns[0].Frozen = true; dgvReport.Columns[1].Frozen = true; } catch (Exception err) { MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { SetButtonEnable(true); Cursor = Cursors.Default; } }
private void btnStat_Click(object sender, EventArgs e) { SetControlEnable(false); DateTime beginDate; DateTime endDate; BaseReport report = null; string accountIdList; string patTypeCode = ""; int statDay = Convert.ToInt32(txtDay.Text); StatDateType dateType = StatDateType.统计日; OPDBillKind invoiceType = OPDBillKind.所有发票; #region 统计条件 foreach (object obj in Enum.GetValues(typeof(StatDateType))) { if (obj.ToString( ) == cboDateType.Text) { dateType = (StatDateType)obj; break; } } foreach (object obj in Enum.GetValues(typeof(OPDBillKind))) { if (obj.ToString( ) == cboInvoiceType.Text) { invoiceType = (OPDBillKind)obj; break; } } if (chkPatType.Checked) { patTypeCode = cboPatType.SelectedValue.ToString( ); } #endregion ReportController.GetReportBeginDateAndEndDate(dateType, statDay, dtpFrom.Value, dtpEnd.Value, out beginDate, out endDate, out accountIdList); lblDate.Text = beginDate.ToString("yyyy-MM-dd HH:mm:ss") + "--" + endDate.ToString("yyyy-MM-dd HH:mm:ss"); try { report = new PatientFeeReport( ); report.BeginDate = beginDate; report.EndDate = endDate; ((PatientFeeReport)report).PatientTypeCode = patTypeCode; ((PatientFeeReport)report).InvoiceType = invoiceType; ((PatientFeeReport)report).CurDocName = chkCureDoc.Checked ? cboDoc.Text : ""; ((PatientFeeReport)report).CurDeptName = chkDept.Checked ? cboDept.Text : ""; ((PatientFeeReport)report).ChargeName = chkSfy.Checked ? cboCharge.Text : ""; report.StatDateType = dateType; report.AccountIdList = accountIdList; report.ReportTitle = "门诊病人费用统计表"; report.Lister = BaseDataController.GetName(BaseDataCatalog.人员列表, employeeId); //PublicDataReader.GetEmployeeNameById( employeeId ); ReportController.FillReport(report); dgvReport.DataSource = report.DataResult; dgvReport.Tag = report; for (int i = 0; i < dgvReport.Columns.Count; i++) { if (i >= 7) { dgvReport.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; dgvReport.Columns[i].Width = 80; } if (i < 8) { dgvReport.Columns[i].Frozen = true; } } } catch { MessageBox.Show("统计发生错误!", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { SetControlEnable(true); } }
private void btnStat_Click(object sender, EventArgs e) { DateTime beginDate; DateTime endDate; BaseReport report = null; string accountIdList; StatDateType dateType = StatDateType.自定义时间; StatClassType statType = StatClassType.门诊发票分类; ReportStyle style = ReportStyle.科目为标题列; foreach (object obj in Enum.GetValues(typeof(StatClassType))) { if (obj.ToString() == cboStatType.Text) { statType = (StatClassType)obj; break; } } foreach (object obj in Enum.GetValues(typeof(ReportStyle))) { if (obj.ToString() == cboStyle.Text) { style = (ReportStyle)obj; break; } } StatObjctType statObjectType = StatObjctType.收费员; try { Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor(); ReportController.GetReportBeginDateAndEndDate(dateType, 15, dtpFrom.Value, dtpEnd.Value, out beginDate, out endDate, out accountIdList); report = new TollerIncomeReport(); report.BeginDate = dtpFrom.Value; report.EndDate = dtpEnd.Value; report.StatType = statType; report.Reportstyle = style; report.StatDateType = dateType; // report.AccountIdList = accountIdList; report.StatObjectType = statObjectType; report.ReportTitle = "门诊收费员工作量统计报表"; report.Lister = BaseDataController.GetName(BaseDataCatalog.人员列表, currentEmployeeId); ReportController.FillReport(report, dtpFrom.Value, dtpEnd.Value); dgvReport.DataSource = report.DataResult; dgvReport.Tag = report; for (int i = 1; i < dgvReport.Columns.Count; i++) { dgvReport.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; dgvReport.Columns[i].Width = 80; } dgvReport.Columns[0].Frozen = true; dgvReport.Columns[1].Frozen = true; } catch (OperatorException oe) { MessageBox.Show(oe.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception err) { ErrorWriter.WriteLog(err.Message); MessageBox.Show("统计报表中发生错误!", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { Cursor = Cursors.Default; } }
private void btnStat_Click(object sender, EventArgs e) { SetControlEnable(false); DateTime beginDate; DateTime endDate; BaseReport report = null; string accountIdList; string patTypeCode = ""; StatDateType dateType = StatDateType.自然时间; OPDBillKind invoiceType = OPDBillKind.所有发票; #region 统计条件 #endregion if (chkIsUseTime.Checked) { ReportController.GetReportBeginDateAndEndDate(dateType, 0, dtpFrom.Value, dtpEnd.Value, out beginDate, out endDate, out accountIdList); } else { ReportController.GetReportBeginDateAndEndDate(dateType, 0, new DateTime(1, 1, 1), new DateTime(9999, 12, 30), out beginDate, out endDate, out accountIdList); } lblDate.Text = beginDate.ToString("yyyy-MM-dd HH:mm:ss") + "--" + endDate.ToString("yyyy-MM-dd HH:mm:ss"); try { report = new PatientFeeReport( ); ((PatientFeeReport)report).PatName = txtPatName.Text; ((PatientFeeReport)report).VisitNo = txtVisitNo.Text; report.BeginDate = beginDate; report.EndDate = endDate; ((PatientFeeReport)report).PatientTypeCode = patTypeCode; ((PatientFeeReport)report).InvoiceType = invoiceType; report.StatDateType = dateType; report.AccountIdList = accountIdList; report.ReportTitle = "门诊病人费用统计表"; report.Lister = PublicDataReader.GetEmployeeNameById(employeeId); ReportController.FillReport(report); dgvReport.DataSource = report.DataResult; dgvReport.Tag = report; for (int i = 0; i < dgvReport.Columns.Count; i++) { if (i >= 3) { dgvReport.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; dgvReport.Columns[i].Width = 80; } if (i < 4) { dgvReport.Columns[i].Frozen = true; } } } catch { MessageBox.Show("统计发生错误!", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { SetControlEnable(true); } }