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_PatientLog : XtraForm { public PatientLogDTO list; DateTime dt = DateTime.Now; public Form_PatientLog() { InitializeComponent(); } private void Form_PatientLog_Load(object sender, EventArgs e) { time_startTime.TimeValue = dt.AddDays(1 - dt.Day).ToString("yyyy-MM-dd"); time_endTime.TimeValue = dt.AddDays(1 - dt.Day).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd"); GetPatientLogList(); } public void GetPatientLogList() { string startTime = ""; if (!string.IsNullOrEmpty(time_startTime.TimeValue.ToString())) startTime = Convert.ToDateTime(time_startTime.TimeValue).ToString("yyyy-MM-dd"); string endTime = ""; if (!string.IsNullOrEmpty(time_endTime.TimeValue.ToString())) endTime = Convert.ToDateTime(time_endTime.TimeValue).ToString("yyyy-MM-dd"); list = DBHelpClass.GetDateModel(string.Format("api/service/T_Service_ChestPain_PatientLog/GetPatientLogList?hospitalGuid={0}&startTime={1}&endTime={2}", Information.Hospital.GUID, startTime, endTime)); if (list != null && list.PatientLogList != null && list.PatientLogList.Count > 0) { gridControl1.DataSource = list.PatientLogList; sbt_Excel.Enabled = true; } else { gridControl1.DataSource = null; sbt_Excel.Enabled = false; } gridView1.BestFitColumns();//列宽自适应 } 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(); } private void sbt_Query_Click(object sender, EventArgs e) { GetPatientLogList(); } private void sbt_Month_Click(object sender, EventArgs e) { time_startTime.TimeValue = dt.AddDays(1 - dt.Day).ToString("yyyy-MM-dd"); time_endTime.TimeValue = dt.AddDays(1 - dt.Day).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd"); GetPatientLogList(); } private void sbt_March_Click(object sender, EventArgs e) { time_startTime.TimeValue = dt.AddMonths(-2).AddDays(1 - dt.Day).ToString("yyyy-MM-dd"); time_endTime.TimeValue = dt.AddDays(1 - dt.Day).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd"); GetPatientLogList(); } private void sbt_June_Click(object sender, EventArgs e) { time_startTime.TimeValue = dt.AddMonths(-5).AddDays(1 - dt.Day).ToString("yyyy-MM-dd"); time_endTime.TimeValue = dt.AddDays(1 - dt.Day).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd"); GetPatientLogList(); } private void sbt_Year_Click(object sender, EventArgs e) { time_startTime.TimeValue = dt.AddMonths(-11).AddDays(1 - dt.Day).ToString("yyyy-MM-dd"); time_endTime.TimeValue = dt.AddDays(1 - dt.Day).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd"); GetPatientLogList(); } private void sbt_All_Click(object sender, EventArgs e) { time_startTime.TimeValue = ""; time_endTime.TimeValue = ""; GetPatientLogList(); } private void sbt_Excel_Click(object sender, EventArgs e) { if (list != null) { MedicalStaffWorkloadListDTO dto = new MedicalStaffWorkloadListDTO(); dto.TitleList = list.Title; dto.list = list.DateList; if (ExcelHelper.MedicalStaffWorkloadStatistics(dto, "胸痛患者工作量日志")) { XtraMessageBox.Show("导出成功!"); } } else { } } } }