StableVersion4.3/HL_FristAidPlatform_Base/Form_InpatientDepartment.cs

94 lines
3.4 KiB
C#
Raw Normal View History

2024-03-11 09:47:34 +08:00
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_Base
{
public partial class Form_InpatientDepartment : XtraForm
{
public Form_InpatientDepartment()
{
InitializeComponent();
}
private void Form_InpatientDepartment_Load(object sender, EventArgs e)
{
DataTable ResultDT = DBHelpClass.Get("/api/admin/T_SYS_SystemModule/GetIsHaveTimeAxisList?isHaveTimeAxis=0");
PublicClass.SetLookUpList(ref lookUpEdit1, ResultDT, 0, 2, false);
GetList();
}
private void btn_Insert_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
Form_InpatientDepartmentInfo frm = new Form_InpatientDepartmentInfo(0, "", 0);
frm.Owner = this;
frm.Show();
}
public void GetList()
{
long systemId = 0;
if (!string.IsNullOrEmpty(lookUpEdit1.Text))
{
systemId = long.Parse(lookUpEdit1.EditValue.ToString());
}
List<InpatientDepartmentDTO> list = DBHelpClass.GetList<InpatientDepartmentDTO>(string.Format("api/base/T_Base_InpatientDepartment/GetList?name={0}&systemId={1}", textEdit1.Text, systemId));
gridControl1.DataSource = list;
}
private void btn_Select_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
GetList();
}
private void btn_Update_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (gridView1.DataRowCount > 0)
{
int selectRow = gridView1.GetSelectedRows()[0];
int id = int.Parse(gridView1.GetRowCellValue(selectRow, "ID").ToString(), 0);
string name = gridView1.GetRowCellValue(selectRow, "Name").ToString();
long systemId = long.Parse(gridView1.GetRowCellValue(selectRow, "SystemModuleID").ToString(), 0);
Form_InpatientDepartmentInfo frm = new Form_InpatientDepartmentInfo(id, name, systemId);
frm.Owner = this;
frm.Show();
}
}
private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
{
if (e.Column.FieldName == "SystemModuleID")
{
string value = e.Value.ToString();
if (value == PublicClassForDataBase.Config10001)
e.DisplayText = "胸痛系统";
if (value == PublicClassForDataBase.Config10002)
e.DisplayText = "卒中系统";
if (value == PublicClassForDataBase.Config10003)
e.DisplayText = "创伤系统";
if (value == PublicClassForDataBase.Config10004)
e.DisplayText = "危重孕产妇系统";
if (value == PublicClassForDataBase.Config10005)
e.DisplayText = "危重新生儿系统";
}
}
private void btn_Delete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
}
}
}