132 lines
4.1 KiB
C#
132 lines
4.1 KiB
C#
using DevExpress.XtraEditors;
|
||
using HL_FristAidPlatform_DTO;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Data;
|
||
using System.Windows.Forms;
|
||
|
||
namespace HL_FristAidPlatform_Public
|
||
{
|
||
public partial class Form_SelectDiseaseTemplate : XtraForm
|
||
{
|
||
#region 变量
|
||
|
||
/// <summary>
|
||
/// 当前筛选的类型编号
|
||
/// </summary>
|
||
private int CurType = 1;
|
||
|
||
/// <summary>
|
||
/// 当前选择的ID集合
|
||
/// </summary>
|
||
public string SelDiseaseTemplateIDS = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 当前选择的名称集合
|
||
/// </summary>
|
||
public string SelDiseaseTemplateS = string.Empty;
|
||
|
||
#endregion 变量
|
||
|
||
/// <summary>
|
||
/// 选择病情模板
|
||
/// </summary>
|
||
/// <param name="type"></param>
|
||
public Form_SelectDiseaseTemplate(int type)
|
||
{
|
||
InitializeComponent();
|
||
CurType = type;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 窗体加载
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
private void Form_SelectDiseaseTemplate_Load(object sender, EventArgs e)
|
||
{
|
||
if (CurType == 100005)
|
||
{
|
||
labelControl1.Visible = false;
|
||
txt_Key.Visible = false;
|
||
|
||
BindTraumaDiseaseTemplate();
|
||
}
|
||
else
|
||
{
|
||
labelControl1.Visible = true;
|
||
txt_Key.Visible = true;
|
||
BindDiseaseTemplate();
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 绑定用户
|
||
/// </summary>
|
||
private void BindDiseaseTemplate()
|
||
{
|
||
try
|
||
{
|
||
DataTable ResultDT = DBHelpClass.Get(string.Format("/api/base/T_Base_DiseaseTemplate/GetList?type={0}&keyWord={1}", CurType, txt_Key.Text.ToString().Trim()));
|
||
grid_Disease.DataSource = ResultDT;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
PublicClass.WriteErrorLog(this.Text, "绑定用户:\r\n" + ex);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 绑定创伤病情模板
|
||
/// </summary>
|
||
private void BindTraumaDiseaseTemplate()
|
||
{
|
||
try
|
||
{
|
||
List<T_Base_DiseaseTemplateDTO> ResultDT = DBHelpClass.GetList<T_Base_DiseaseTemplateDTO>(string.Format("/api/base/T_Base_Diagnosis/GetDiagnosisTreeList"));
|
||
grid_Disease.DataSource = ResultDT;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
PublicClass.WriteErrorLog(this.Text, "绑定用户:\r\n" + ex);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 确认选择
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
private void btn_Sure_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
int[] rownumber = grv_Disease.GetSelectedRows();//获取选中行号;
|
||
SelDiseaseTemplateIDS = string.Empty;
|
||
SelDiseaseTemplateS = string.Empty;
|
||
|
||
foreach (int i in rownumber)
|
||
{
|
||
//根据行号获取相应行的数据;
|
||
SelDiseaseTemplateIDS += grv_Disease.GetRowCellValue(i, "ID").ToString() + ",";
|
||
SelDiseaseTemplateS += grv_Disease.GetRowCellValue(i, "Content").ToString() + ";";
|
||
}
|
||
|
||
if (!string.IsNullOrEmpty(SelDiseaseTemplateIDS))
|
||
{
|
||
SelDiseaseTemplateIDS = SelDiseaseTemplateIDS.Substring(0, SelDiseaseTemplateIDS.Length - 1);
|
||
DialogResult = DialogResult.OK;
|
||
Close();
|
||
}
|
||
else
|
||
{
|
||
XtraMessageBox.Show("请先勾选您要选择的病情模板!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
PublicClass.WriteErrorLog(this.Text, "确认选择:\r\n" + ex);
|
||
}
|
||
}
|
||
}
|
||
} |