StableVersion4.3/HL_ChestPain_Statistics/Form_ChestPain_Certificatio...

240 lines
9.1 KiB
C#

using DevExpress.XtraEditors;
using HL_FristAidPlatform_Public;
using System;
using System.Data;
using System.Drawing;
namespace HL_FristAidPlatform_ChestPain_Statistics
{
/// <summary>
/// 指标分析统计
/// </summary>
public partial class Form_ChestPain_CertificationList : XtraForm
{
public Form_ChestPain_CertificationList()
{
InitializeComponent();
}
/// <summary>
/// 窗体加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Form_ChestPain_CertificationList_Load(object sender, EventArgs e)
{
BindHospital();
date_Start.TimeValue = DateTime.Now.AddMonths(-6).ToShortDateString();
date_End.TimeValue = DateTime.Now.ToShortDateString();
//是否为基层版
if (Information.Hospital.CP_CertificationVersion == PublicClassForDataBase.Config122)
{
radioGroup_CP_First_Reperfusion.EditValue = Information.Hospital.CP_First_Reperfusion;
PublicClass.SetItemChecked(checkedList_CP_Second_Reperfusion, Information.Hospital.CP_Second_Reperfusion, '|');
panel_CP_Reperfusion.Visible = true;
}
else
{
panel_CP_Reperfusion.Visible = false;
}
BindList();
}
/// <summary>
/// 绑定机构信息
/// </summary>
private void BindHospital()
{
try
{
//数据源
DataTable ResultDT = new DataTable();
//有所有院区权限
if (PublicHelp.IsHaveAllDistrictRight(Information.User.ID))
{
string Url = "api/base/T_Base_Hospital/GetList";
ResultDT = DBHelpClass.Get(Url);
}
//只获取当前院区数据
else
{
string Url = string.Format("api/base/T_Base_Hospital/{0}", Information.Hospital.GUID);
ResultDT = DBHelpClass.GetDataRow(Url);
}
PublicClass.SetLookUpList(lookUp_Hospital, ResultDT, "guid", "name", true);
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(this.Text, "绑定机构信息:\r\n" + ex);
}
}
/// <summary>
/// 绑定列表
/// </summary>
private void BindList()
{
try
{
string whereStr = "cp_First_Reperfusion=0&";
string VersionGUID = Information.Hospital.CP_CertificationVersion;
//首选再灌注
//if (!string.IsNullOrEmpty(Information.Hospital.CP_First_Reperfusion))
//{
// whereStr += "cp_First_Reperfusion=" + Information.Hospital.CP_First_Reperfusion + "&";
//}
whereStr += "cp_First_Reperfusion=" + PublicClass.ToString(radioGroup_CP_First_Reperfusion.EditValue, "") + "&";
//次选再灌注
//if (!string.IsNullOrEmpty(Information.Hospital.CP_Second_Reperfusion))
//{
// string[] strList = Information.Hospital.CP_Second_Reperfusion.Split('|');
// foreach (string str in strList)
// {
// whereStr += "cp_First_Reperfusion=" + str + "&";
// }
//}
string Standard_CP_First_Reperfusion = string.Empty;
string Standard_CP_First_ReperfusionText = string.Empty;
int SelectCount = 0;
PublicClass.GetCheckedListBoxItemValues(checkedList_CP_Second_Reperfusion, "|", out Standard_CP_First_Reperfusion, out Standard_CP_First_ReperfusionText, out SelectCount);
if (SelectCount > 0)
{
string[] strList = Standard_CP_First_Reperfusion.Split('|');
foreach (string str in strList)
{
whereStr += "cp_First_Reperfusion=" + str + "&";
}
}
DataTable ResultDT = DBHelpClass.Get(string.Format("api/base/T_Base_CertificationStandard/GetList?versionGUID={0}&{1}keyWord={2}", VersionGUID, whereStr, ""));
grid_Standard.DataSource = ResultDT;//显示分页结果
grv_Standard.BestFitColumns();//列宽自适应
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(Text, "绑定列表:\r\n" + ex);
}
}
/// <summary>
/// 颜色绘制
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void grv_Standard_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
{
if (grv_Standard.DataRowCount > 0)
{
string isKey = PublicClass.ToString(grv_Standard.GetRowCellValue(e.RowHandle, "IsKey"), "");
//改变整行颜色
if (isKey == "0")
{
e.Appearance.ForeColor = Color.Red;
}
}
}
/// <summary>
/// 列表操作
/// </summary>gc 65dtgx
/// <param name="sender"></param>
/// <param name="e"></param>
private void repositoryItemButtonEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
switch (e.Button.Caption)
{
case "查看":
ShowReport();
break;
default:
break;
}
}
/// <summary>
/// 显示报表
/// </summary>
private void ShowReport()
{
try
{
if (grv_Standard.DataRowCount > 0)
{
int selectRow = grv_Standard.GetSelectedRows()[0];
string DLLName = PublicClass.ToString(grv_Standard.GetRowCellValue(selectRow, "DLLName"), "");
string FunctionName = PublicClass.ToString(grv_Standard.GetRowCellValue(selectRow, "FunctionName"), "");
string HospitalGuid = PublicClass.ToString(lookUp_Hospital.EditValue, "");
string StartDate = PublicClass.ToDateTime(date_Start.TimeValue, PublicClass.DefaultTime).ToString(PublicClass.DateToString) + " 00:00:00";
string EndDate = PublicClass.ToDateTime(date_End.TimeValue, PublicClass.DefaultTime).ToString(PublicClass.DateToString) + " 23:59:59";
string DataType = PublicClass.ToString(radioGroup_DataType.EditValue, "");
string ReportType = PublicClass.ToString(radioGroup_ReportType.EditValue, "");
string ReportName = PublicClass.ToString(grv_Standard.GetRowCellValue(selectRow, "Stamp"), "");
string ReportTitle = PublicClass.ToString(grv_Standard.GetRowCellValue(selectRow, "StandardContent"), "");
//是否为基层版
if (Information.Hospital.CP_CertificationVersion == PublicClassForDataBase.Config122)
{
Form_Report_Basic form = new Form_Report_Basic(HospitalGuid, StartDate, EndDate, DataType, ReportType, ReportName, ReportTitle);
form.MdiParent = this.MdiParent;
form.Show();
}
//标准版
else
{
Form_Report_Standard form = new Form_Report_Standard(HospitalGuid, StartDate, EndDate, DataType, ReportType, ReportName, ReportTitle);
form.MdiParent = this.MdiParent;
form.Show();
}
}
}
catch (Exception ex)
{
PublicClass.WriteErrorLog(this.Text, "显示报表:\r\n" + ex);
}
}
/// <summary>
/// 绘制行号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void grv_Standard_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
{
if (e.Info.IsRowIndicator && e.RowHandle > -1)
{
e.Info.DisplayText = (e.RowHandle + 1).ToString();
}
}
/// <summary>
/// 基层版首选
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void radioGroup_CP_First_Reperfusion_SelectedIndexChanged(object sender, EventArgs e)
{
BindList();
}
/// <summary>
/// 基层版次选
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void checkedList_CP_Second_Reperfusion_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
{
BindList();
}
}
}