StableVersion4.3/HL_FristAidPlatform_FollowUp/Form_ADL.cs

226 lines
8.6 KiB
C#

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_FollowUp
{
public partial class Form_ADL : XtraForm
{
string _guid;
/// <summary>
/// 评分
/// </summary>
public int scor1;
public int scor2;
public int scor3;
public int scor4;
public int scor5;
public int scor6;
public int scor7;
public int scor8;
public int scor9;
public int scor10;
public Form_ADL(string patientGUID="")
{
_guid = patientGUID;
InitializeComponent();
}
private void radioGroup1_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup1.SelectedIndex > -1)
{
scor1 =Convert.ToInt32(radioGroup1.EditValue.ToString());
lbl_adlsocre.Text = (scor1 + scor2 + scor3 + scor4 + scor5 + scor6 + scor7 + scor8 + scor9 + scor10).ToString();
}
}
private void radioGroup2_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup2.SelectedIndex > -1)
{
scor2 = Convert.ToInt32(radioGroup2.EditValue.ToString());
lbl_adlsocre.Text = (scor1 + scor2 + scor3 + scor4 + scor5 + scor6 + scor7 + scor8 + scor9 + scor10).ToString();
}
}
private void radioGroup3_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup3.SelectedIndex > -1)
{
scor3 = Convert.ToInt32(radioGroup3.EditValue.ToString());
lbl_adlsocre.Text = (scor1 + scor2 + scor3 + scor4 + scor5 + scor6 + scor7 + scor8 + scor9 + scor10).ToString();
}
}
private void radioGroup4_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup4.SelectedIndex > -1)
{
scor4 = Convert.ToInt32(radioGroup4.EditValue.ToString());
lbl_adlsocre.Text = (scor1 + scor2 + scor3 + scor4 + scor5 + scor6 + scor7 + scor8 + scor9 + scor10).ToString();
}
}
private void radioGroup5_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup5.SelectedIndex > -1)
{
scor5 = Convert.ToInt32(radioGroup5.EditValue.ToString());
lbl_adlsocre.Text = (scor1 + scor2 + scor3 + scor4 + scor5 + scor6 + scor7 + scor8 + scor9 + scor10).ToString();
}
}
private void radioGroup6_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup6.SelectedIndex > -1)
{
scor6 = Convert.ToInt32(radioGroup6.EditValue.ToString());
lbl_adlsocre.Text = (scor1 + scor2 + scor3 + scor4 + scor5 + scor6 + scor7 + scor8 + scor9 + scor10).ToString();
}
}
private void radioGroup7_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup7.SelectedIndex > -1)
{
scor7 = Convert.ToInt32(radioGroup7.EditValue.ToString());
lbl_adlsocre.Text = (scor1 + scor2 + scor3 + scor4 + scor5 + scor6 + scor7 + scor8 + scor9 + scor10).ToString();
}
}
private void radioGroup8_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup8.SelectedIndex > -1)
{
scor8 = Convert.ToInt32(radioGroup8.EditValue.ToString());
lbl_adlsocre.Text = (scor1 + scor2 + scor3 + scor4 + scor5 + scor6 + scor7 + scor8 + scor9 + scor10).ToString();
}
}
private void radioGroup9_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup9.SelectedIndex > -1)
{
scor9 = Convert.ToInt32(radioGroup9.EditValue.ToString());
lbl_adlsocre.Text = (scor1 + scor2 + scor3 + scor4 + scor5 + scor6 + scor7 + scor8 + scor9 + scor10).ToString();
}
}
private void radioGroup10_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup10.SelectedIndex > -1)
{
scor10 = Convert.ToInt32(radioGroup10.EditValue.ToString());
lbl_adlsocre.Text = (scor1 + scor2 + scor3 + scor4 + scor5 + scor6 + scor7 + scor8 + scor9 + scor10).ToString();
}
}
private void simpleButton1_Click(object sender, EventArgs e)
{
try
{
Getdata();
}
catch (Exception ex)
{
throw ex;
}
Form_FollowUpDetail_FollowUpEvaluation evaluation;
evaluation = (Form_FollowUpDetail_FollowUpEvaluation)this.Owner;
evaluation.RefreshADL(lbl_adlsocre.Text);
this.Close();
}
private void Form_ADL_Load(object sender, EventArgs e)
{
try
{
string url = string.Format("api/service/T_Service_Apoplexy_ScoreSummary/GetADLScoreByPatientGuidAndFlag?patientGuid={0}", _guid, 1);
T_Base_ADLScoreDTO ADLScoreDTO = DBHelpClass.GetDateModel<T_Base_ADLScoreDTO>(url);
if (ADLScoreDTO != null)
{
if (!string.IsNullOrEmpty(ADLScoreDTO.Shit + ""))
radioGroup1.EditValue = ADLScoreDTO.Shit + "";
if (!string.IsNullOrEmpty(ADLScoreDTO.Urine + ""))
radioGroup2.EditValue = ADLScoreDTO.Urine + "";
if (!string.IsNullOrEmpty(ADLScoreDTO.Modification + ""))
radioGroup3.EditValue = ADLScoreDTO.Modification + "";
if (!string.IsNullOrEmpty(ADLScoreDTO.Toiletuse + ""))
radioGroup4.EditValue = ADLScoreDTO.Toiletuse + "";
if (!string.IsNullOrEmpty(ADLScoreDTO.Eat + ""))
radioGroup5.EditValue = ADLScoreDTO.Eat + "";
if (!string.IsNullOrEmpty(ADLScoreDTO.Transfer + ""))
radioGroup6.EditValue = ADLScoreDTO.Transfer + "";
if (!string.IsNullOrEmpty(ADLScoreDTO.Activity + ""))
radioGroup7.EditValue = ADLScoreDTO.Activity + "";
if (!string.IsNullOrEmpty(ADLScoreDTO.Dressing + ""))
radioGroup8.EditValue = ADLScoreDTO.Dressing + "";
if (!string.IsNullOrEmpty(ADLScoreDTO.Climbstairs + ""))
radioGroup9.EditValue = ADLScoreDTO.Climbstairs + "";
if (!string.IsNullOrEmpty(ADLScoreDTO.Shower + ""))
radioGroup10.EditValue = ADLScoreDTO.Shower + "";
lbl_adlsocre.Text = ADLScoreDTO.TotalScore + "";
}
}
catch (Exception ex)
{
throw ex;
}
}
public void Getdata()
{
T_Base_ADLScoreDTO ADLScoreDTO = new T_Base_ADLScoreDTO();
List<T_Base_ADLScoreDTO> list = new List<T_Base_ADLScoreDTO>();
ADLScoreDTO.PatientGUID = _guid;
ADLScoreDTO.flag = 0;
ADLScoreDTO.TotalScore = lbl_adlsocre.Text + "";
ADLScoreDTO.CreatorID = Information.User.ID;
ADLScoreDTO.Shit = radioGroup1.EditValue + "";
ADLScoreDTO.Urine = radioGroup2.EditValue + "";
ADLScoreDTO.Modification = radioGroup3.EditValue + "";
ADLScoreDTO.Toiletuse = radioGroup4.EditValue + "";
ADLScoreDTO.Eat = radioGroup5.EditValue + "";
ADLScoreDTO.Transfer = radioGroup6.EditValue + "";
ADLScoreDTO.Activity = radioGroup7.EditValue + "";
ADLScoreDTO.Dressing = radioGroup8.EditValue + "";
ADLScoreDTO.Climbstairs = radioGroup9.EditValue + "";
ADLScoreDTO.Shower = radioGroup10.EditValue + "";
list.Add(ADLScoreDTO);
string Url = "api/service/T_Service_Apoplexy_ScoreSummary/AddORUpdateADLScore";
//初始化两个工厂
ClientFactory<T_Base_ADLScoreDTO> httpClient = new HttpClientFactory<T_Base_ADLScoreDTO>();
Client<T_Base_ADLScoreDTO> client = httpClient.VisitFactory();
//访问
ListEntity<T_Base_ADLScoreDTO> t = client.Post(Url, list);
}
}
}