StableVersion4.3/HL_FristAidPlatform_Emergen.../Form_SelectDiseaseTemplate.cs

77 lines
2.6 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using DevExpress.XtraEditors;
using HL_FristAidPlatform_Public;
using System;
using System.Data;
using System.Windows.Forms;
namespace HL_FristAidPlatform_EmergencyTriage
{
public partial class Form_SelectDiseaseTemplate : Form
{
#region 变量
/// <summary>
/// 当前筛选的类型编号
/// </summary>
private int CurType = 1;
/// <summary>
/// 当前选择的ID集合
/// </summary>
public string SelDiseaseTemplateIDS = string.Empty;
/// <summary>
/// 当前选择的名称集合
/// </summary>
public string SelDiseaseTemplateS = string.Empty;
#endregion
public Form_SelectDiseaseTemplate(int type)
{
InitializeComponent();
CurType = type;
}
private void Form_SelectDiseaseTemplate_Load(object sender, EventArgs e)
{
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);
}
}
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);
}
}
}
}