81 lines
2.4 KiB
C#
81 lines
2.4 KiB
C#
using DevExpress.XtraEditors;
|
|
using System;
|
|
using System.Data;
|
|
using System.Windows.Forms;
|
|
|
|
namespace HL_FristAidPlatform_Public
|
|
{
|
|
public partial class Form_Diagnosis : XtraForm
|
|
{
|
|
public string diagnosisValue;
|
|
private DataTable dataTable;
|
|
|
|
public Form_Diagnosis()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Form_Diagnosis_Load(object sender, EventArgs e)
|
|
{
|
|
dataTable = DBHelpClass.Get("api/base/T_Base_Diagnosis/GetDiagnosisDetailsList");
|
|
gridControl1.DataSource = dataTable;
|
|
}
|
|
|
|
private void textEdit1_KeyPress(object sender, KeyPressEventArgs e)
|
|
{
|
|
if (!string.IsNullOrEmpty(textEdit1.Text))
|
|
{
|
|
string filterExpression = string.Format("Name like '%{0}%'", textEdit1.Text + "");
|
|
DataTable table = dataTable.Clone();
|
|
foreach (var item in dataTable.Select(filterExpression))
|
|
{
|
|
table.Rows.Add(item.ItemArray);
|
|
}
|
|
gridControl1.DataSource = table;
|
|
}
|
|
else
|
|
{
|
|
gridControl1.DataSource = dataTable;
|
|
}
|
|
}
|
|
|
|
private void textEdit1_Enter(object sender, EventArgs e)
|
|
{
|
|
textEdit1.Text = "";
|
|
}
|
|
|
|
private void simpleButton1_Click(object sender, EventArgs e)
|
|
{
|
|
gridView1.SelectAll();
|
|
}
|
|
|
|
private void simpleButton3_Click(object sender, EventArgs e)
|
|
{
|
|
gridView1.ClearSelection();
|
|
}
|
|
|
|
private void simpleButton2_Click(object sender, EventArgs e)
|
|
{
|
|
for (int i = 0; i < gridView1.RowCount; i++)
|
|
{
|
|
gridView1.InvertRowSelection(i);
|
|
}
|
|
}
|
|
|
|
private void simpleButton4_Click(object sender, EventArgs e)
|
|
{
|
|
int[] rownumber = this.gridView1.GetSelectedRows();//获取选中行号;
|
|
if (rownumber.Length > 0)
|
|
{
|
|
for (int i = 0; i < rownumber.Length; i++)
|
|
{
|
|
if (!string.IsNullOrEmpty(diagnosisValue))
|
|
diagnosisValue += ",";
|
|
diagnosisValue += gridView1.GetRowCellValue(rownumber[i], "Name").ToString();
|
|
}
|
|
}
|
|
DialogResult = DialogResult.OK;
|
|
this.Close();
|
|
}
|
|
}
|
|
} |