StableVersion4.3/HL_FristAidPlatform_Apoplexy/InterventionWorkScale/UserControl_SAH.cs

122 lines
5.1 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_Apoplexy
{
public partial class UserControl_SAH : UserControl
{
string PatientGuid;
public UserControl_SAH(string _PatientGuid)
{
InitializeComponent();
PatientGuid = _PatientGuid;
}
private void UserControl_SAH_Load(object sender, EventArgs e)
{
BB_ZWMBYZD_And_BB_ZWMPGZL_DTO Cur_PatientDetailDT = DBHelpClass.GetDateModel<BB_ZWMBYZD_And_BB_ZWMPGZL_DTO>(string.Format("api/service/T_Service_Apoplexy_BB_ZWMBYZD/GetByPatientGuid?PatientGuid={0}", PatientGuid));
if (Cur_PatientDetailDT != null)
{
PublicClass.SetItemChecked(checkedListBoxControl_ZWMCause, Cur_PatientDetailDT.ZWMCause, ';');
textBox_ZWMCauseQiTa.Text = Cur_PatientDetailDT.ZWMCauseQiTa;
radioGroup_ZWMPGFisherYN.EditValue = Cur_PatientDetailDT.ZWMPGFisherYN;
textBox_ZWMPGFisher.Text = Cur_PatientDetailDT.ZWMPGFisher;
radioGroup_ZWMPGYzCc.EditValue = Cur_PatientDetailDT.ZWMPGYzCc;
radioGroup_ZWMPGXueXingYN.EditValue = Cur_PatientDetailDT.ZWMPGXueXingYN;
radioGroup_ZWMPGNimodipineYN.EditValue = Cur_PatientDetailDT.ZWMPGNimodipineYN;
textBox_ZWMPGGCS.Text = Cur_PatientDetailDT.ZWMPGGCS;
radioGroup_ZWMPGGCSYN.EditValue = Cur_PatientDetailDT.ZWMPGGCSYN;
radioGroup_ZWMPGNaoShanYN.EditValue = Cur_PatientDetailDT.ZWMPGNaoShanYN;
textBox_ZWMPGCYGCS.Text = Cur_PatientDetailDT.ZWMPGCYGCS;
radioGroup_ZWMPGCYGCSYN.EditValue = Cur_PatientDetailDT.ZWMPGCYGCSYN;
}
}
private void checkedListBoxControl_ZWMCause_SelectedValueChanged(object sender, EventArgs e)
{
if (checkedListBoxControl_ZWMCause.SelectedValue + "" == "99")
{
textBox_ZWMCauseQiTa.Visible = true;
}
else
{
textBox_ZWMCauseQiTa.Visible = false;
}
}
public void save()
{
string Url = string.Empty;
List<BB_ZWMBYZD_And_BB_ZWMPGZL_DTO> list = new List<BB_ZWMBYZD_And_BB_ZWMPGZL_DTO>();
BB_ZWMBYZD_And_BB_ZWMPGZL_DTO model = new BB_ZWMBYZD_And_BB_ZWMPGZL_DTO();
Url = "api/service/T_Service_Apoplexy_BB_ZWMBYZD/Update";
model.PatientGUID = PatientGuid + "";
string SyndromeNumber;
string Syndrome;
PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl_ZWMCause, ";", out SyndromeNumber, out Syndrome);
model.ZWMCause = SyndromeNumber + "";
model.ZWMCauseQiTa = textBox_ZWMCauseQiTa.Text;
model.ZWMPGFisherYN = radioGroup_ZWMPGFisherYN.EditValue + "";
model.ZWMCause = SyndromeNumber + "";
model.ZWMPGFisher = textBox_ZWMPGFisher.Text;
model.ZWMPGYzCc = radioGroup_ZWMPGYzCc.EditValue + "";
model.ZWMPGXueXingYN = radioGroup_ZWMPGXueXingYN.EditValue + "";
model.ZWMPGNimodipineYN = radioGroup_ZWMPGNimodipineYN.EditValue + "";
model.ZWMPGGCS = textBox_ZWMPGGCS.Text;
model.ZWMPGGCSYN = radioGroup_ZWMPGGCSYN.EditValue + "";
model.ZWMPGNaoShanYN = radioGroup_ZWMPGNaoShanYN.EditValue + "";
model.ZWMPGCYGCS = textBox_ZWMPGCYGCS.Text;
model.ZWMPGCYGCSYN = radioGroup_ZWMPGCYGCSYN.EditValue + "";
list.Add(model);
ClientFactory<BB_ZWMBYZD_And_BB_ZWMPGZL_DTO> httpClient = new HttpClientFactory<BB_ZWMBYZD_And_BB_ZWMPGZL_DTO>();
Client<BB_ZWMBYZD_And_BB_ZWMPGZL_DTO> client = httpClient.VisitFactory();
//访问
ListEntity<BB_ZWMBYZD_And_BB_ZWMPGZL_DTO> t = client.Post(Url, list);
if (t.Success)
{
XtraMessageBox.Show("保存成功!");
}
else
{
XtraMessageBox.Show("保存失败!");
}
}
private void checkedListBoxControl_ZWMCause_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
{
//string SyndromeNumber;
//string Syndrome;
//PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl_ZWMCause, ";", out SyndromeNumber, out Syndrome);
//var selectValue = SyndromeNumber.Split(';');
foreach (var item in checkedListBoxControl_ZWMCause.CheckedItems)
{
if (item.ToString() == "其他")
{
textBox_ZWMCauseQiTa.Visible = true;
}
else
{
textBox_ZWMCauseQiTa.Visible = false;
textBox_ZWMCauseQiTa.Text = "";
}
}
}
}
}