StableVersion4.3/HL_FristAidPlatform_FollowUp/Form_PatientMRS.cs

125 lines
3.6 KiB
C#

using DevExpress.XtraEditors;
using HL_FristAidPlatform_DTO;
using System;
using System.Windows.Forms;
namespace HL_FristAidPlatform_FollowUp
{
public partial class Form_PatientMRS : XtraForm
{
public int flag;
public string mrsScore;
//设置委托
public delegate void TextEventHandler(string strText, PatientMRSDTO dto);
public TextEventHandler TextHandler;
private PatientMRSDTO dto;
public Form_PatientMRS()
{
InitializeComponent();
}
public Form_PatientMRS(int _flag)
{
InitializeComponent();
flag = _flag;
}
private void Form_PatientMRS_Load(object sender, EventArgs e)
{
radioGroup1.SelectedIndex = -1;
dto = new PatientMRSDTO();
}
private void radioGroup1_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup1.SelectedIndex != -1)
{
mrsScore = radioGroup1.SelectedIndex + "";
labelControl2.Text = radioGroup1.SelectedIndex + "";
dto.TotalScore = int.Parse(mrsScore);
}
}
private void simpleButton1_Click(object sender, EventArgs e)
{
if (flag == 1)
{
//入院时MRS评分
if (null != TextHandler)
{
dto.Flag = 1;
int temp = int.Parse(labelControl2.Text + "");
if (temp == 0)
{
dto.AsymptomaticScore = temp;
}
if (temp == 1)
{
dto.SubtleScore = temp;
}
if (temp == 2)
{
dto.MildScore = temp;
}
if (temp == 3)
{
dto.ModerateScore = temp;
}
if (temp == 4)
{
dto.SevereScore = temp;
}
if (temp == 5)
{
dto.SeriousScore = temp;
}
TextHandler.Invoke(labelControl2.Text, dto);
DialogResult = DialogResult.OK;
}
this.Close();
}
if (flag == 2)
{
//出院时MRS评分
if (null != TextHandler)
{
dto.Flag = 2;
int temp = int.Parse(labelControl2.Text + "");
if (temp == 0)
{
dto.AsymptomaticScore = temp;
}
if (temp == 1)
{
dto.SubtleScore = temp;
}
if (temp == 2)
{
dto.MildScore = temp;
}
if (temp == 3)
{
dto.ModerateScore = temp;
}
if (temp == 4)
{
dto.SevereScore = temp;
}
if (temp == 5)
{
dto.SeriousScore = temp;
}
TextHandler.Invoke(labelControl2.Text, dto);
DialogResult = DialogResult.OK;
}
this.Close();
}
}
}
}