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_Moyamoya : UserControl { string PatientGuid; T_Service_Apoplexy_NCXYWBDTO CEACAS; public UserControl_Moyamoya(string _PatientGuid) { InitializeComponent(); PatientGuid = _PatientGuid; } private void UserControl_Moyamoya_Load(object sender, EventArgs e) { CEACAS = DBHelpClass.GetDateModel(string.Format("api/service/T_Service_Apoplexy_NCXYWB/GetByPatientGuid?PatientGuid={0}", PatientGuid)); if (CEACAS != null) { radioGroup_YWBType.EditValue = CEACAS.YWBType; radioGroup_YWBHistoryYN.EditValue = CEACAS.YWBHistoryYN; timeControl_YWBFaBingTime.TimeValue = CEACAS.YWBFaBingTime; radioGroup_YWBOpPast.EditValue = CEACAS.YWBOpPast; radioGroup_YWBXGSide.EditValue = CEACAS.YWBXGSide; PublicClass.SetItemChecked(checkedListBoxControl_YWBLSide, CEACAS.YWBLSide, ';'); textEdit_YWBLOther.Text = CEACAS.YWBLOther; PublicClass.SetItemChecked(checkedListBoxControl_YWBRSide, CEACAS.YWBRSide, ';'); textEdit_YWBROther.Text = CEACAS.YWBROther; radioGroup_YWBDCYN.EditValue = CEACAS.YWBDCYN; radioGroup_YWBZLYN.EditValue = CEACAS.YWBZLYN; timeControl_YWBZLStartTime.TimeValue = CEACAS.YWBFaBingTime; PublicClass.SetItemChecked(checkedListBoxControl_YWBLZLWays, CEACAS.YWBLZLWays, ';'); textEdit_YWBLZLOther.Text = CEACAS.YWBLZLOther; PublicClass.SetItemChecked(checkedListBoxControl_YWBRZLWays, CEACAS.YWBRZLWays, ';'); textEdit_YWBRZLOther.Text = CEACAS.YWBRZLOther; PublicClass.SetItemChecked(checkedListBoxControl_YWBBFZ, CEACAS.YWBBFZ, ';'); textEdit_YWBBFZOther.Text = CEACAS.YWBBFZOther; } } public void save() { string Url = "api/service/T_Service_Apoplexy_NCXYWB/AddORUpdate"; List list = new List(); T_Service_Apoplexy_NCXYWBDTO model = new T_Service_Apoplexy_NCXYWBDTO(); model.YWBType = radioGroup_YWBType.EditValue + ""; model.YWBHistoryYN = radioGroup_YWBHistoryYN.EditValue + ""; model.YWBFaBingTime = timeControl_YWBFaBingTime.TimeValue + ""; model.YWBOpPast = radioGroup_YWBOpPast.EditValue + ""; model.YWBXGSide = radioGroup_YWBXGSide.EditValue + ""; model.PatientGuid = PatientGuid; string SyndromeNumber; string Syndrome; PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl_YWBLSide, ";", out SyndromeNumber, out Syndrome); model.YWBLSide = SyndromeNumber; model.YWBLOther = textEdit_YWBLOther.Text; string SyndromeNumber1; string Syndrome1; PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl_YWBRSide, ";", out SyndromeNumber1, out Syndrome1); model.YWBRSide = SyndromeNumber1; model.YWBROther = textEdit_YWBROther.Text; model.YWBDCYN = radioGroup_YWBDCYN.EditValue + ""; model.YWBZLYN = radioGroup_YWBZLYN.EditValue + ""; model.YWBFaBingTime = timeControl_YWBZLStartTime.TimeValue + ""; string SyndromeNumber2; string Syndrome2; PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl_YWBLZLWays, ";", out SyndromeNumber2, out Syndrome2); model.YWBLZLWays = SyndromeNumber2; model.YWBLZLOther = textEdit_YWBLZLOther.Text; string SyndromeNumber3; string Syndrome3; PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl_YWBRZLWays, ";", out SyndromeNumber3, out Syndrome3); model.YWBRZLWays = SyndromeNumber3; model.YWBRZLOther = textEdit_YWBRZLOther.Text; string SyndromeNumber4; string Syndrome4; PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl_YWBBFZ, ";", out SyndromeNumber4, out Syndrome4); model.YWBBFZ = SyndromeNumber4; model.YWBBFZOther = textEdit_YWBBFZOther.Text; list.Add(model); ClientFactory httpClient = new HttpClientFactory(); Client client = httpClient.VisitFactory(); //访问 ListEntity t = client.Post(Url, list); if (t.Success) { XtraMessageBox.Show("保存成功!"); } else { XtraMessageBox.Show("保存失败!"); } } private void checkedListBoxControl_YWBLSide_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) { foreach(var item in checkedListBoxControl_YWBLSide.CheckedItems) { if (item.ToString() =="其他") { textEdit_YWBLOther.Visible = true; labelControl6.Visible = true; } else { labelControl6.Visible = false; textEdit_YWBLOther.Visible = false; textEdit_YWBLOther.Text = ""; } } } /// /// 联动2 /// /// /// private void checkedListBoxControl_YWBRSide_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) { foreach(var item in checkedListBoxControl_YWBRSide.CheckedItems) { if (item.ToString()== "其他") { labelControl4.Visible = true; textEdit_YWBROther.Visible = true; } else { labelControl4.Visible = false; textEdit_YWBROther.Visible = false; textEdit_YWBROther.Text = ""; } } } } }