StableVersion4.3/HL_FristAidPlatform_Apoplexy/CommunityFollowup/Form_CommunityFollowup.cs

425 lines
17 KiB
C#
Raw Permalink Normal View History

2024-03-11 09:47:34 +08:00
using DevExpress.XtraEditors;
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_Apoplexy
{
public partial class Form_CommunityFollowup : XtraForm
{
Form_BaseInfo _BaseInfo;
Form_LifeStyle _LifeStyle;
Form_MedicalHistory _MedicalHistory;
Form_Surgery _Surgery;
Form_PhysicalExamination _PhysicalExamination;
Form_LaboratoryExamination _LaboratoryExamination;
string flag;
string pageIndex = "1";
string patientGUID;
string name;
string idcard;
string age;
string gender;
public Form_CommunityFollowup(string _patientGUID = "", string _name = "", string _idcard = "", string _age = "", string _gender = "", string _flag="1")
{
patientGUID = _patientGUID;
name = _name;
idcard = _idcard;
age = _age;
gender = _gender;
flag = _flag;
InitializeComponent();
}
private void Form_CommunityFollowup_Load(object sender, EventArgs e)
{
lbl_name.Text = name;
if (gender == "1")
{
lbl_Gender.Text = "男";
}
else if(gender=="2")
{
lbl_Gender.Text = "女";
}
else
{
lbl_Gender.Text = "未知";
}
lbl_Age.Text = age;
if (flag == "1")
{
LabelClick(lbl_one);
}
if (flag == "3")
{
LabelClick(lbl_three);
}
if (flag == "6")
{
LabelClick(lbl_six);
}
if (flag == "9")
{
LabelClick(lbl_Nine);
}
if (flag == "12")
{
LabelClick(lbl_twelve);
}
ChangeColorMenu(panel_info);
LoadForm();
}
public void LoadForm()
{
LoadComponents();
}
public void LabelClick(LabelControl labelControl)
{
labelControl.BackColor = Color.FromArgb(45, 140, 240);
}
public void LabelNonClick(LabelControl labelControl)
{
labelControl.BackColor = Color.Transparent;
}
private void labelControl4_Click(object sender, EventArgs e)
{
flag = "9";
LabelClick(lbl_Nine);
LabelNonClick(lbl_three);
LabelNonClick(lbl_one);
LabelNonClick(lbl_twelve);
LabelNonClick(lbl_six);
LoadForm();
}
private void labelControl5_Click(object sender, EventArgs e)
{
flag = "12";
LabelClick(lbl_twelve);
LabelNonClick(lbl_three);
LabelNonClick(lbl_one);
LabelNonClick(lbl_Nine);
LabelNonClick(lbl_six);
LoadForm();
}
private void lbl_six_Click(object sender, EventArgs e)
{
flag = "6";
LabelClick(lbl_six);
LabelNonClick(lbl_three);
LabelNonClick(lbl_one);
LabelNonClick(lbl_Nine);
LabelNonClick(lbl_twelve);
LoadForm();
}
private void lbl_three_Click(object sender, EventArgs e)
{
flag = "3";
LabelClick(lbl_three);
LabelNonClick(lbl_six);
LabelNonClick(lbl_one);
LabelNonClick(lbl_Nine);
LabelNonClick(lbl_twelve);
LoadForm();
}
private void lbl_one_Click(object sender, EventArgs e)
{
flag = "1";
LabelClick(lbl_one);
LabelNonClick(lbl_six);
LabelNonClick(lbl_three);
LabelNonClick(lbl_Nine);
LabelNonClick(lbl_twelve);
LoadForm();
}
public void LoadComponents()
{
if (pageIndex == "1")
{
panelmain.Controls.Clear();
_BaseInfo = new Form_BaseInfo(patientGUID, flag, name);
_BaseInfo.WindowState = FormWindowState.Maximized;
_BaseInfo.TopLevel = false;// 将子窗体设置为非顶级控件
_BaseInfo.Parent = panelmain;
_BaseInfo.FormBorderStyle = FormBorderStyle.None;//设置无边框
_BaseInfo.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
_BaseInfo.Show();
panelmain.Controls.Add(_BaseInfo);
}
else if (pageIndex == "2")
{
panelmain.Controls.Clear();
_LifeStyle = new Form_LifeStyle(patientGUID, flag);
_LifeStyle.WindowState = FormWindowState.Maximized;
_LifeStyle.TopLevel = false;// 将子窗体设置为非顶级控件
_LifeStyle.Parent = panelmain;
_LifeStyle.FormBorderStyle = FormBorderStyle.None;//设置无边框
_LifeStyle.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
_LifeStyle.Show();
panelmain.Controls.Add(_LifeStyle);
}
else if (pageIndex == "3")
{
panelmain.Controls.Clear();
_MedicalHistory = new Form_MedicalHistory(patientGUID, flag);
_MedicalHistory.WindowState = FormWindowState.Maximized;
_MedicalHistory.TopLevel = false;// 将子窗体设置为非顶级控件
_MedicalHistory.Parent = panelmain;
_MedicalHistory.FormBorderStyle = FormBorderStyle.None;//设置无边框
_MedicalHistory.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
_MedicalHistory.Show();
panelmain.Controls.Add(_MedicalHistory);
}
else if (pageIndex == "4")
{
panelmain.Controls.Clear();
_Surgery = new Form_Surgery(patientGUID, flag);
_Surgery.WindowState = FormWindowState.Maximized;
_Surgery.TopLevel = false;// 将子窗体设置为非顶级控件
_Surgery.Parent = panelmain;
_Surgery.FormBorderStyle = FormBorderStyle.None;//设置无边框
_Surgery.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
_Surgery.Show();
panelmain.Controls.Add(_Surgery);
}
else if (pageIndex == "5")
{
panelmain.Controls.Clear();
_PhysicalExamination = new Form_PhysicalExamination(patientGUID, flag);
_PhysicalExamination.WindowState = FormWindowState.Maximized;
_PhysicalExamination.TopLevel = false;// 将子窗体设置为非顶级控件
_PhysicalExamination.Parent = panelmain;
_PhysicalExamination.FormBorderStyle = FormBorderStyle.None;//设置无边框
_PhysicalExamination.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
_PhysicalExamination.Show();
panelmain.Controls.Add(_PhysicalExamination);
}
else if (pageIndex == "6")
{
panelmain.Controls.Clear();
_LaboratoryExamination = new Form_LaboratoryExamination(patientGUID, flag);
_LaboratoryExamination.WindowState = FormWindowState.Maximized;
_LaboratoryExamination.TopLevel = false;// 将子窗体设置为非顶级控件
_LaboratoryExamination.Parent = panelmain;
_LaboratoryExamination.FormBorderStyle = FormBorderStyle.None;//设置无边框
_LaboratoryExamination.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
_LaboratoryExamination.Show();
panelmain.Controls.Add(_LaboratoryExamination);
}
#region 旧代码
//if (xtraTabControl1.SelectedTabPage == xtraTabPage1)
//{
// pageIndex = "1";
// panelControlBaseInfo.Controls.Clear();
// _BaseInfo = new Form_BaseInfo(patientGUID, flag, name, idcard);
// _BaseInfo.WindowState = FormWindowState.Maximized;
// _BaseInfo.TopLevel = false;// 将子窗体设置为非顶级控件
// _BaseInfo.Parent = panelControlBaseInfo;
// _BaseInfo.FormBorderStyle = FormBorderStyle.None;//设置无边框
// _BaseInfo.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
// _BaseInfo.Show();
// panelControlBaseInfo.Controls.Add(_BaseInfo);
//}
//else if (xtraTabControl1.SelectedTabPage == xtraTabPage2)
//{
// pageIndex = "2";
// panelControlLifeStyle.Controls.Clear();
// _LifeStyle = new Form_LifeStyle(patientGUID, flag);
// _LifeStyle.WindowState = FormWindowState.Maximized;
// _LifeStyle.TopLevel = false;// 将子窗体设置为非顶级控件
// _LifeStyle.Parent = panelControlLifeStyle;
// _LifeStyle.FormBorderStyle = FormBorderStyle.None;//设置无边框
// _LifeStyle.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
// _LifeStyle.Show();
// panelControlLifeStyle.Controls.Add(_LifeStyle);
//}
//else if (xtraTabControl1.SelectedTabPage == xtraTabPage3)
//{
// pageIndex = "3";
// panelControlMedicalHistory.Controls.Clear();
// _MedicalHistory = new Form_MedicalHistory(patientGUID, flag);
// _MedicalHistory.WindowState = FormWindowState.Maximized;
// _MedicalHistory.TopLevel = false;// 将子窗体设置为非顶级控件
// _MedicalHistory.Parent = panelControlMedicalHistory;
// _MedicalHistory.FormBorderStyle = FormBorderStyle.None;//设置无边框
// _MedicalHistory.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
// _MedicalHistory.Show();
// panelControlMedicalHistory.Controls.Add(_MedicalHistory);
//}
//else if (xtraTabControl1.SelectedTabPage == xtraTabPage4)
//{
// pageIndex = "4";
// panelControlSurgery.Controls.Clear();
// _Surgery = new Form_Surgery(patientGUID, flag);
// _Surgery.WindowState = FormWindowState.Maximized;
// _Surgery.TopLevel = false;// 将子窗体设置为非顶级控件
// _Surgery.Parent = panelControlSurgery;
// _Surgery.FormBorderStyle = FormBorderStyle.None;//设置无边框
// _Surgery.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
// _Surgery.Show();
// panelControlSurgery.Controls.Add(_Surgery);
//}
//else if (xtraTabControl1.SelectedTabPage == xtraTabPage5)
//{
// pageIndex = "5";
// panelControlPhysicalExamination.Controls.Clear();
// _PhysicalExamination = new Form_PhysicalExamination(patientGUID, flag);
// _PhysicalExamination.WindowState = FormWindowState.Maximized;
// _PhysicalExamination.TopLevel = false;// 将子窗体设置为非顶级控件
// _PhysicalExamination.Parent = panelControlPhysicalExamination;
// _PhysicalExamination.FormBorderStyle = FormBorderStyle.None;//设置无边框
// _PhysicalExamination.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
// _PhysicalExamination.Show();
// panelControlPhysicalExamination.Controls.Add(_PhysicalExamination);
//}
//else if (xtraTabControl1.SelectedTabPage == xtraTabPage6)
//{
// pageIndex = "6";
// panelControlLaboratoryExamination.Controls.Clear();
// _LaboratoryExamination = new Form_LaboratoryExamination(patientGUID, flag);
// _LaboratoryExamination.WindowState = FormWindowState.Maximized;
// _LaboratoryExamination.TopLevel = false;// 将子窗体设置为非顶级控件
// _LaboratoryExamination.Parent = panelControlLaboratoryExamination;
// _LaboratoryExamination.FormBorderStyle = FormBorderStyle.None;//设置无边框
// _LaboratoryExamination.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
// _LaboratoryExamination.Show();
// panelControlLaboratoryExamination.Controls.Add(_LaboratoryExamination);
//}
#endregion
}
private void simpleButton1_Click(object sender, EventArgs e)
{
switch (pageIndex)
{
case "1":
_BaseInfo.SaveBaseInfo();
break;
case "2":
_LifeStyle.SaveLifeStyle();
break;
case "3":
_MedicalHistory.SaveMedicalHistory();
break;
case "4":
_Surgery.SaveSurgery();
break;
case "5":
_PhysicalExamination.SavePhysicalExamination();
break;
case "6":
_LaboratoryExamination.SaveLaboratoryExamination();
break;
}
}
private void Form_CommunityFollowup_SizeChanged(object sender, EventArgs e)
{
if (_BaseInfo != null || _LifeStyle != null || _MedicalHistory != null || _Surgery != null || _PhysicalExamination != null || _LaboratoryExamination != null)
LoadComponents();
}
public void ChangeColorMenu(PanelControl panel)
{
panel.Appearance.BackColor = Color.FromArgb(45, 140, 240);
}
public void RrecoverColorMenu(PanelControl panel)
{
panel.Appearance.BackColor = Color.FromArgb(92, 173, 255);
}
private void picture_BaseInfo_Click(object sender, EventArgs e)
{
pageIndex = "1";
ChangeColorMenu(panel_info);
RrecoverColorMenu(panel_lifestyle);
RrecoverColorMenu(panel_medicalhistory);
RrecoverColorMenu(panel_physicalExamination);
RrecoverColorMenu(panel_laboratoryExamination);
RrecoverColorMenu(panel_surgery);
LoadComponents();
}
private void picture_LifeStyle_Click(object sender, EventArgs e)
{
pageIndex = "2";
ChangeColorMenu(panel_lifestyle);
RrecoverColorMenu(panel_info);
RrecoverColorMenu(panel_medicalhistory);
RrecoverColorMenu(panel_physicalExamination);
RrecoverColorMenu(panel_laboratoryExamination);
RrecoverColorMenu(panel_surgery);
LoadComponents();
}
private void picture_MedicalHistory_Click(object sender, EventArgs e)
{
pageIndex = "3";
ChangeColorMenu(panel_medicalhistory);
RrecoverColorMenu(panel_info);
RrecoverColorMenu(panel_lifestyle);
RrecoverColorMenu(panel_physicalExamination);
RrecoverColorMenu(panel_laboratoryExamination);
RrecoverColorMenu(panel_surgery);
LoadComponents();
}
private void picture_Surgery_Click(object sender, EventArgs e)
{
pageIndex = "4";
ChangeColorMenu(panel_surgery);
RrecoverColorMenu(panel_info);
RrecoverColorMenu(panel_lifestyle);
RrecoverColorMenu(panel_physicalExamination);
RrecoverColorMenu(panel_laboratoryExamination);
RrecoverColorMenu(panel_medicalhistory);
LoadComponents();
}
private void picture_PhysicalExamination_Click(object sender, EventArgs e)
{
pageIndex = "5";
ChangeColorMenu(panel_physicalExamination);
RrecoverColorMenu(panel_info);
RrecoverColorMenu(panel_lifestyle);
RrecoverColorMenu(panel_surgery);
RrecoverColorMenu(panel_laboratoryExamination);
RrecoverColorMenu(panel_medicalhistory);
LoadComponents();
}
private void picture_LaboratoryExamination_Click(object sender, EventArgs e)
{
pageIndex = "6";
ChangeColorMenu(panel_laboratoryExamination);
RrecoverColorMenu(panel_info);
RrecoverColorMenu(panel_lifestyle);
RrecoverColorMenu(panel_surgery);
RrecoverColorMenu(panel_physicalExamination);
RrecoverColorMenu(panel_medicalhistory);
LoadComponents();
}
}
}