public FrmIncomeReport(int OperatorId, string FormTitle) { InitializeComponent( ); this.Text = FormTitle; this.FormTitle = FormTitle; OperatorName = PublicDataReader.GetEmployeeNameById(OperatorId); }
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 = ""; 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); } }