StableVersion4.3/HL_FristAidPlatform_Apoplexy/InterventionWorkScale/UserControl_AVM.cs

190 lines
7.7 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_Apoplexy
{
public partial class UserControl_AVM : UserControl
{
string PatientGuid;
T_Service_Apoplexy_NCXAVMDTO CEACAS;
public int sum1;
public int sum2;
public int sum3;
public UserControl_AVM(string _PatientGuid)
{
InitializeComponent();
PatientGuid = _PatientGuid;
}
private void UserControl_AVM_Load(object sender, EventArgs e)
{
CEACAS = DBHelpClass.GetDateModel<T_Service_Apoplexy_NCXAVMDTO>(string.Format("api/service/T_Service_Apoplexy_NCXAVM/GetByPatientGuid_AVM?PatientGuid={0}", PatientGuid));
if (CEACAS != null)
{
radioGroup_AVMType.EditValue = CEACAS.AVMType;
radioGroup_AVMSize.EditValue = CEACAS.AVMSize;
radioGroup_AVMCharacter.EditValue = CEACAS.AVMCharacter;
radioGroup_AVMYinLiu.EditValue = CEACAS.AVMYinLiu;
textEdit_AVMMarin.Text = CEACAS.AVMMarin;
radioGroup_AVMXueShuanYN.EditValue = CEACAS.AVMXueShuanYN;
radioGroup_AVMSSZLYN.EditValue = CEACAS.AVMSSZLYN;
timeControl_AVMZLTime.TimeValue = CEACAS.AVMZLTime;
PublicClass.SetItemChecked(checkedListBoxControl_AVMCeLue, CEACAS.AVMCeLue, ';');
PublicClass.SetItemChecked(checkedListBoxControl_AVMBFZ, CEACAS.AVMBFZ, ';');
textEdit_AVMBFZOther.Text = CEACAS.AVMBFZOther;
PublicClass.SetItemChecked(checkedListBoxControl_AVMLSite, CEACAS.AVMLSite, ';');
PublicClass.SetItemChecked(checkedListBoxControl_AVMRSite, CEACAS.AVMRSite, ';');
PublicClass.SetItemChecked(checkedListBoxControl_AVMMSite, CEACAS.AVMMSite, ';');
textEdit_AVMMSiteOther.Text = CEACAS.AVMMSiteOther;
}
}
public void save()
{
string Url = "api/service/T_Service_Apoplexy_NCXAVM/AddORUpdate";
List<T_Service_Apoplexy_NCXAVMDTO> list = new List<T_Service_Apoplexy_NCXAVMDTO>();
T_Service_Apoplexy_NCXAVMDTO model = new T_Service_Apoplexy_NCXAVMDTO();
model.PatientGuid = PatientGuid;
model.AVMType = radioGroup_AVMType.EditValue + "";
model.AVMSize = radioGroup_AVMSize.EditValue + "";
model.AVMCharacter = radioGroup_AVMCharacter.EditValue + "";
model.AVMYinLiu = radioGroup_AVMYinLiu.EditValue + "";
model.AVMMarin = textEdit_AVMMarin.Text;
model.AVMXueShuanYN = radioGroup_AVMXueShuanYN.EditValue + "";
model.AVMSSZLYN = radioGroup_AVMSSZLYN.EditValue + "";
model.AVMZLTime = timeControl_AVMZLTime.TimeValue + "";
string SyndromeNumber;
string Syndrome;
PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl_AVMCeLue, ";", out SyndromeNumber, out Syndrome);
model.AVMCeLue = SyndromeNumber;
string SyndromeNumber1;
string Syndrome1;
PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl_AVMBFZ, ";", out SyndromeNumber1, out Syndrome1);
model.AVMBFZ = SyndromeNumber1;
model.AVMBFZOther = textEdit_AVMBFZOther.Text;
string SyndromeNumber2;
string Syndrome2;
PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl_AVMLSite, ";", out SyndromeNumber2, out Syndrome2);
model.AVMLSite = SyndromeNumber2;
string SyndromeNumber3;
string Syndrome3;
PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl_AVMRSite, ";", out SyndromeNumber3, out Syndrome3);
model.AVMRSite = SyndromeNumber3;
string SyndromeNumber4;
string Syndrome4;
PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl_AVMMSite, ";", out SyndromeNumber4, out Syndrome4);
model.AVMMSite = SyndromeNumber4;
model.AVMMSiteOther = textEdit_AVMMSiteOther.Text;
list.Add(model);
ClientFactory<T_Service_Apoplexy_NCXAVMDTO> httpClient = new HttpClientFactory<T_Service_Apoplexy_NCXAVMDTO>();
Client<T_Service_Apoplexy_NCXAVMDTO> client = httpClient.VisitFactory();
//访问
ListEntity<T_Service_Apoplexy_NCXAVMDTO> t = client.Post(Url, list);
if (t.Success)
{
XtraMessageBox.Show("保存成功!");
}
else
{
XtraMessageBox.Show("保存失败!");
}
}
private void radioGroup_AVMSize_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup_AVMSize.SelectedIndex > -1)
{
sum1 = radioGroup_AVMSize.SelectedIndex + 1;
int i = sum1 + sum2 + sum3;
textEdit_AVMMarin.Text = i.ToString();
}
}
private void radioGroup_AVMCharacter_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup_AVMCharacter.SelectedIndex > -1)
{
sum2 = radioGroup_AVMCharacter.SelectedIndex;
int i = sum1 + sum2 + sum3;
textEdit_AVMMarin.Text = i.ToString();
}
}
private void radioGroup_AVMYinLiu_SelectedIndexChanged(object sender, EventArgs e)
{
if (radioGroup_AVMYinLiu.SelectedIndex > -1)
{
sum3 = radioGroup_AVMYinLiu.SelectedIndex;
int i = sum1 + sum2 + sum3;
textEdit_AVMMarin.Text = i.ToString();
}
}
private void checkedListBoxControl_AVMMSite_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
{
foreach (var item in checkedListBoxControl_AVMMSite.CheckedItems)
{
if (item.ToString() == "其他")
{
textEdit_AVMMSiteOther.Visible = true;
labelControl19.Visible = true;
}
else
{
textEdit_AVMMSiteOther.Visible = false;
labelControl19.Visible = false;
textEdit_AVMMSiteOther.Text = "";
}
}
}
private void checkedListBoxControl_AVMBFZ_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
{
foreach (var item in checkedListBoxControl_AVMBFZ.CheckedItems)
{
if (item.ToString()=="其他")
{
textEdit_AVMBFZOther.Visible = true;
labelControl18.Visible = true;
}
else
{
textEdit_AVMBFZOther.Visible = false;
labelControl18.Visible = false;
textEdit_AVMBFZOther.Text = "";
}
}
//if (checkedListBoxControl_AVMBFZ.CheckedItems. == "99")
//{
// if (e.State == CheckState.Checked)
// {
// textEdit_AVMBFZOther.Visible = true;
// labelControl18.Visible = true;
// }
// else
// {
// textEdit_AVMBFZOther.Visible = false;
// labelControl18.Visible = false;
// textEdit_AVMBFZOther.Text = "";
// }
//}
}
}
}