175 lines
6.1 KiB
C#
175 lines
6.1 KiB
C#
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Windows.Forms;
|
|
using System.IO;
|
|
using Datalib.EntityClasses;
|
|
using Datalib.HelperClasses;
|
|
using System.Linq;
|
|
using DevExpress.XtraEditors;
|
|
using System.Drawing;
|
|
using DevExpress.Spreadsheet;
|
|
using Datalib.Linq;
|
|
using System.Text.RegularExpressions;
|
|
using PatientMan.Classes;
|
|
|
|
|
|
namespace PatientMan.Forms
|
|
{
|
|
public partial class frmReports : PatientMan.BasicForms.frmCommon
|
|
{
|
|
private int SelectedReportIndex { get; set; }
|
|
public frmReports()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Cancel_Click(object sender, EventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
|
|
private void frmReports_Load(object sender, EventArgs e)
|
|
{
|
|
BeginDate.EditValue = DateTime.Today;
|
|
EndDate.EditValue = DateTime.Today;
|
|
this.SelectedReportIndex = 0;
|
|
|
|
}
|
|
|
|
private void OK_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
{
|
|
|
|
switch (SelectedReportIndex)
|
|
{
|
|
case 0:
|
|
D28();
|
|
break;
|
|
case 1:
|
|
Hivqual();
|
|
break;
|
|
case 2:
|
|
FHIRep();
|
|
break;
|
|
case 3:
|
|
C03quartly();
|
|
break;
|
|
case 4:
|
|
C03Annual();
|
|
break;
|
|
case 5:
|
|
Mer();
|
|
break;
|
|
|
|
}
|
|
}
|
|
|
|
private void cbReports_EditValueChanged(object sender, EventArgs e)
|
|
{
|
|
string templateFile = "";
|
|
string path = Application.StartupPath;
|
|
SelectedReportIndex = ((ComboBoxEdit)sender).SelectedIndex;
|
|
switch (SelectedReportIndex)
|
|
{
|
|
case 0: templateFile = path + @"\templates\d8.xls"; this.barExport.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; break;
|
|
case 1: templateFile = path + @"\templates\Hivqual.xls"; this.barExport.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; break;
|
|
case 2: templateFile = path + @"\templates\progress.xls"; this.barExport.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; break;
|
|
case 3: templateFile = path + @"\templates\C03quartly.xls"; this.barExport.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; break;
|
|
case 4: templateFile = path + @"\templates\C03annual.xls"; this.barExport.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; break;
|
|
case 5: templateFile = path + @"\templates\MER.xls"; this.barExport.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; break;
|
|
|
|
|
|
}
|
|
this.spreadsheetControl.LoadDocument(templateFile);
|
|
}
|
|
|
|
private void SaveAs_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
{
|
|
if (this.SaveFileDialog.ShowDialog() == DialogResult.OK)
|
|
{
|
|
this.spreadsheetControl.SaveDocument(SaveFileDialog.FileName, DocumentFormat.Xls);
|
|
MessageBox.Show("Quá trình két xuất bao cáo đã thành công", "Kết xuất", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
}
|
|
}
|
|
|
|
private void D28()
|
|
{
|
|
clsD28 D28 = new clsD28();
|
|
D28.spreed = this.spreadsheetControl;
|
|
D28.BeginDate = (DateTime)this.BeginDate.EditValue;
|
|
D28.EndDate = (DateTime)this.EndDate.EditValue;
|
|
D28.Calculate();
|
|
|
|
|
|
}
|
|
private void Hivqual()
|
|
{
|
|
clsHivqual HivQual = new clsHivqual();
|
|
HivQual.spreed = this.spreadsheetControl;
|
|
HivQual.BeginDate = (DateTime)this.BeginDate.EditValue;
|
|
HivQual.EndDate = (DateTime)this.EndDate.EditValue;
|
|
HivQual.Calculate();
|
|
|
|
}
|
|
private void FHIRep()
|
|
{
|
|
clsProgress Progress = new clsProgress();
|
|
Progress.BeginDate = (DateTime)this.BeginDate.EditValue;
|
|
Progress.EndDate = (DateTime)this.EndDate.EditValue;
|
|
Progress.spreed = this.spreadsheetControl;
|
|
Progress.Calculate();
|
|
|
|
}
|
|
|
|
private void C03quartly()
|
|
{
|
|
clsC03Quartly C03 = new clsC03Quartly();
|
|
C03.spreed = this.spreadsheetControl;
|
|
C03.BeginDate = (DateTime)this.BeginDate.EditValue;
|
|
C03.EndDate = (DateTime)this.EndDate.EditValue;
|
|
C03.Calculate();
|
|
|
|
}
|
|
private void C03Annual()
|
|
{
|
|
clsC03Annual C03 = new clsC03Annual();
|
|
C03.spreed = this.spreadsheetControl;
|
|
C03.BeginDate = (DateTime)this.BeginDate.EditValue;
|
|
C03.EndDate = (DateTime)this.EndDate.EditValue;
|
|
C03.Calculate();
|
|
}
|
|
private void Mer()
|
|
{
|
|
clsMer Mer = new clsMer();
|
|
Mer.spreed = this.spreadsheetControl;
|
|
Mer.BeginDate = (DateTime)this.BeginDate.EditValue;
|
|
Mer.EndDate = (DateTime)this.EndDate.EditValue;
|
|
Mer.Calculate();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void barLateAppointment_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
{
|
|
(new clsLateAppointment()).FixLateAppointMent();
|
|
}
|
|
|
|
private void barHivQualExport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
{
|
|
|
|
clsHivQualExport HivQual = new clsHivQualExport();
|
|
HivQual.BeginDate = (DateTime)this.BeginDate.EditValue;
|
|
HivQual.EndDate = (DateTime)this.EndDate.EditValue;
|
|
HivQual.HivQual();
|
|
}
|
|
|
|
private void barCD4Export_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
{
|
|
clsHivQualExport HivQual = new clsHivQualExport();
|
|
HivQual.BeginDate = (DateTime)this.BeginDate.EditValue;
|
|
HivQual.EndDate = (DateTime)this.EndDate.EditValue;
|
|
HivQual.CD4();
|
|
}
|
|
}
|
|
} |