StableVersion4.3/HL_FristAidPlatform_ChestPain/Form_ChestPain_MedicalStaff...

211 lines
6.3 KiB
C#

using DevExpress.XtraEditors;
using HL_FristAidPlatform_DTO;
using HL_FristAidPlatform_Public;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HL_FristAidPlatform_ChestPain
{
public partial class Form_ChestPain_MedicalStaffWorkloadStatistics : XtraForm
{
List<MedicalStaffWorkloadDTO> dt;
public Form_ChestPain_MedicalStaffWorkloadStatistics()
{
InitializeComponent();
}
private void simpleButton7_Click(object sender, EventArgs e)
{
try
{
string startTime = "";
string endTime = "";
if (!string.IsNullOrEmpty(timeControl1.TimeValue + ""))
{
startTime = timeControl1.TimeValue + "";
}
if (!string.IsNullOrEmpty(timeControl2.TimeValue + ""))
{
endTime = timeControl2.TimeValue + "";
}
MedicalStaffWorkloadListDTO model = new MedicalStaffWorkloadListDTO();
model = DBHelpClass.GetDateModel<MedicalStaffWorkloadListDTO>(string.Format("api/service/T_Service_ChestPain_MedicalStaffWorkloadStatistics/GetMedicalStaffWorkloadStatisticsListToExcel?hospitalGuid={0}&startTime={1}&endTime={2}", Information.Hospital.GUID, startTime, endTime));
if (ExcelHelper.MedicalStaffWorkloadStatistics(model, "胸痛医护人员工作数据"))
{
XtraMessageBox.Show("导出成功!");
}
}
catch (Exception ex)
{
throw;
}
}
private void Form_ChestPain_MedicalStaffWorkloadStatistics_Load(object sender, EventArgs e)
{
try
{
DateTime dt = DateTime.Now;
timeControl1.TimeValue = dt.AddDays(1 - dt.Day).ToString("yyyy-MM-dd");
timeControl2.TimeValue = dt.AddDays(1 - dt.Day).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");
GetMedicalStaffWorkloadStatistics();
}
catch (Exception ex)
{
throw ex;
}
}
public void GetMedicalStaffWorkloadStatistics()
{
try
{
string startTime = "";
string endTime = "";
if (!string.IsNullOrEmpty(timeControl1.TimeValue + ""))
{
startTime = timeControl1.TimeValue + "";
}
if (!string.IsNullOrEmpty(timeControl2.TimeValue + ""))
{
endTime = timeControl2.TimeValue + "";
}
dt = DBHelpClass.GetList<MedicalStaffWorkloadDTO>(string.Format("api/service/T_Service_ChestPain_MedicalStaffWorkloadStatistics/GetMedicalStaffWorkloadStatisticsList?hospitalGuid={0}&startTime={1}&endTime={2}", Information.Hospital.GUID, startTime, endTime));
gridControl1.DataSource = dt;
gridView1.BestFitColumns();//列宽自适应
}
catch (Exception ex)
{
throw ex;
}
}
private void simpleButton6_Click(object sender, EventArgs e)
{
try
{
GetMedicalStaffWorkloadStatistics();
}
catch (Exception ex)
{
throw ex;
}
}
private void simpleButton1_Click(object sender, EventArgs e)
{
try
{
DateTime dt = DateTime.Now;
timeControl1.TimeValue = dt.AddDays(1 - dt.Day).ToString("yyyy-MM-dd");
timeControl2.TimeValue = dt.AddDays(1 - dt.Day).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");
GetMedicalStaffWorkloadStatistics();
}
catch (Exception ex)
{
throw ex;
}
}
private void simpleButton2_Click(object sender, EventArgs e)
{
try
{
DateTime dt = DateTime.Now;
timeControl1.TimeValue = dt.AddMonths(-2).AddDays(1 - dt.Day).ToString("yyyy-MM-dd");
timeControl2.TimeValue = dt.AddDays(1 - dt.Day).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");
GetMedicalStaffWorkloadStatistics();
}
catch (Exception ex)
{
throw ex;
}
}
private void simpleButton3_Click(object sender, EventArgs e)
{
try
{
DateTime dt = DateTime.Now;
timeControl1.TimeValue = dt.AddMonths(-5).AddDays(1 - dt.Day).ToString("yyyy-MM-dd");
timeControl2.TimeValue = dt.AddDays(1 - dt.Day).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");
GetMedicalStaffWorkloadStatistics();
}
catch (Exception ex)
{
throw ex;
}
}
private void simpleButton4_Click(object sender, EventArgs e)
{
try
{
DateTime dt = DateTime.Now;
timeControl1.TimeValue = dt.AddMonths(-11).AddDays(1 - dt.Day).ToString("yyyy-MM-dd");
timeControl2.TimeValue = dt.AddDays(1 - dt.Day).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");
GetMedicalStaffWorkloadStatistics();
}
catch (Exception ex)
{
throw ex;
}
}
private void simpleButton5_Click(object sender, EventArgs e)
{
try
{
timeControl1.TimeValue = "";
timeControl2.TimeValue = "";
GetMedicalStaffWorkloadStatistics();
}
catch (Exception ex)
{
throw ex;
}
}
private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
{
if (e.Info.IsRowIndicator && e.RowHandle >= 0)
e.Info.DisplayText = (e.RowHandle + 1).ToString();
}
}
}