2023-08-16 22:32:16 +08:00

162 lines
6.4 KiB
C#

using AIMSBLL;
using DocumentManagement;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace AIMS.OperationAanesthesia
{
public partial class frmSafetyExamine : Form
{
public int PatientId;
public PatientRecord Patient;
private PublicUI.UI.frmSelectPerson frmOperationDoctor = new PublicUI.UI.frmSelectPerson();
private PublicUI.UI.frmSelectPerson frmtxtAnesthesiaDoctor = new PublicUI.UI.frmSelectPerson();
private PublicUI.UI.frmSelectPerson frmInstrumentNurse = new PublicUI.UI.frmSelectPerson();
private List<int> SelectOperationDoctor = new List<int>(); //主刀医生
private List<int> SelecttxtAnesthesiaDoctorData = new List<int>(); //麻醉医生
private List<int> SelectInstrumentNurseData = new List<int>(); //器械护士
public frmSafetyExamine()
{
InitializeComponent();
}
private void frmSafetyExamine_Load(object sender, EventArgs e)
{
Patient = PatientRecord.GetPatientRecord(PatientId);
txtNo.Text=Patient.MdrecNo;
txtname.Text = Patient.PatientName;
txtsex.Text = Patient.Sex;
txtage.Text = Patient.Age;
txtAnesthesiaDoctor.Text=Patient.AnesthesiaDoctor;
txtOperationDoctor.Text=Patient.OperationDoctor;
txtInstrumentNurse.Text=Patient.InstrumentNurse;
}
private void OperationDoctor_Click(object sender, EventArgs e)
{
frmOperationDoctor = new PublicUI.UI.frmSelectPerson();
frmOperationDoctor.PersonType = "医生";
frmOperationDoctor.SelectDepartmentName = Patient.ApplyDepName;
frmOperationDoctor.SelectPersonData = SelectOperationDoctor;
frmOperationDoctor.FormClosed += new FormClosedEventHandler(frmSelectPerson_FormClosed);
frmOperationDoctor.ShowDialog();
}
void frmSelectPerson_FormClosed(object sender, FormClosedEventArgs e)
{
txtOperationDoctor.Text = "";
if (frmOperationDoctor.SelectPersonData.Count > 0)
{
SelectOperationDoctor = frmOperationDoctor.SelectPersonData;
foreach (int RowId in frmOperationDoctor.SelectPersonData)
{
txtOperationDoctor.Text += BPerson.SelectSingle(RowId).Name + " ,";
}
int idxStart = txtOperationDoctor.Text.LastIndexOf(" ,");
txtOperationDoctor.Text = txtOperationDoctor.Text.Substring(0, idxStart);
}
}
private void txtAnesthesiaDoctor_Click(object sender, EventArgs e)
{
frmtxtAnesthesiaDoctor = new PublicUI.UI.frmSelectPerson();
frmtxtAnesthesiaDoctor.PersonType = "医生";
frmtxtAnesthesiaDoctor.SelectDepartmentName = Patient.ApplyDepName;
frmtxtAnesthesiaDoctor.SelectPersonData = SelecttxtAnesthesiaDoctorData;
frmtxtAnesthesiaDoctor.FormClosed += new FormClosedEventHandler(frmSelectPerson2_FormClosed);
frmtxtAnesthesiaDoctor.ShowDialog();
}
void frmSelectPerson2_FormClosed(object sender, FormClosedEventArgs e)
{
txtAnesthesiaDoctor.Text = "";
if (frmtxtAnesthesiaDoctor.SelectPersonData.Count > 0)
{
SelecttxtAnesthesiaDoctorData = frmtxtAnesthesiaDoctor.SelectPersonData;
foreach (int RowId in frmtxtAnesthesiaDoctor.SelectPersonData)
{
txtAnesthesiaDoctor.Text += BPerson.SelectSingle(RowId).Name + " ,";
}
int idxStart = txtAnesthesiaDoctor.Text.LastIndexOf(" ,");
txtAnesthesiaDoctor.Text = txtAnesthesiaDoctor.Text.Substring(0, idxStart);
}
}
private void txtInstrumentNurse_Click(object sender, EventArgs e)
{
frmInstrumentNurse = new PublicUI.UI.frmSelectPerson();
frmInstrumentNurse.PersonType = "手术室护士";
frmInstrumentNurse.SelectDepartmentName = "手术室";
frmInstrumentNurse.SelectPersonData = SelectInstrumentNurseData;
frmInstrumentNurse.FormClosed += new FormClosedEventHandler(frmInstrumentNurse_FormClosed);
frmInstrumentNurse.ShowDialog();
}
void frmInstrumentNurse_FormClosed(object sender, FormClosedEventArgs e)
{
txtInstrumentNurse.Text = "";
if (frmInstrumentNurse.SelectPersonData.Count > 0)
{
SelectInstrumentNurseData = frmInstrumentNurse.SelectPersonData;
foreach (int RowId in frmInstrumentNurse.SelectPersonData)
{
txtInstrumentNurse.Text += BPerson.SelectSingle(RowId).Name + ",";
}
int idxStart = txtInstrumentNurse.Text.LastIndexOf(",");
txtInstrumentNurse.Text = txtInstrumentNurse.Text.Substring(0, idxStart);
}
}
private static void ClearControlsContent(Control cl)
{
for (int i = 0; i < cl.Controls.Count; i++)
{
if (cl.Controls[i].Controls.Count > 0)
{
ClearControlsContent(cl.Controls[i] as Control);
}
RadioButton radioButton = cl.Controls[i] as RadioButton;
if (radioButton != null)
{
if (radioButton.Text == "是")
{
radioButton.Checked = true;
}
}
else
{
CheckBox cb = cl.Controls[i] as CheckBox;
if (cb != null)
{
if (cb.Text == "是")
{
cb.Checked = true;
}
if (cb.Text == "有")
{
cb.Checked = true;
}
}
}
}
}
private void checkBox24_CheckedChanged(object sender, EventArgs e)
{
ClearControlsContent(panelOper);
ClearControlsContent(panelEx2);
ClearControlsContent(panelEx3);
checkBox25.Checked = true;
}
private void buttonX1_Click(object sender, EventArgs e)
{
}
}
}