using DevExpress.XtraEditors; using HL_FristAidPlatform_DTO; using HL_FristAidPlatform_Public; using System; using System.Collections.Generic; using System.Data; using System.Windows.Forms; namespace HL_FristAidPlatform_EMRS { public partial class Form_SpecialityCheckUpInfo : XtraForm { private string _patientGuid; private string guid; private string guid1; private string guid2; public Form_SpecialityCheckUpInfo(string patientGuid) { InitializeComponent(); _patientGuid = patientGuid; } private void Form_SpecialityCheckUpInfo_Load(object sender, EventArgs e) { QueryInfo(_patientGuid); } public void QueryInfo(string guid) { string url = string.Format("/api/service/T_Service_FirstAid_SpecialityCheckUp/GetSpecialityCheckUpInfo?guid={0}", _patientGuid); DataTable dt = DBHelpClass.GetDataRow(url); if (dt != null) { if (dt.Rows.Count > 0) { guid1 = dt.Rows[0]["GUID"].ToString(); #region 专科检查 radioGroup_BrainType.SelectedIndex = PublicClass.ToInt32(dt.Rows[0]["BrainType"], -1); memo_BrainInjury.Text = dt.Rows[0]["BranInjury"].ToString(); radioGroup_MaxillofacialType.SelectedIndex = PublicClass.ToInt32(dt.Rows[0]["MaxillofacialType"], -1); memo_MaxillofacialInjury.Text = dt.Rows[0]["MaxillofacialInjury"].ToString(); radioGroup_ChestType.SelectedIndex = PublicClass.ToInt32(dt.Rows[0]["ChestType"], -1); memo_ChestInjury.Text = dt.Rows[0]["ChestInjury"].ToString(); radioGroup_AbdomenType.SelectedIndex = PublicClass.ToInt32(dt.Rows[0]["AbdomenType"], -1); memo_AbdomenInjury.Text = dt.Rows[0]["AbdomenInjury"].ToString(); radioGroup_BackType.SelectedIndex = PublicClass.ToInt32(dt.Rows[0]["BackType"], -1); memo_BackInjury.Text = dt.Rows[0]["BackInjury"].ToString(); radioGroup_SpineType.SelectedIndex = PublicClass.ToInt32(dt.Rows[0]["SpineType"], -1); memo_SpineInjury.Text = dt.Rows[0]["SpineInjury"].ToString(); radioGroup_limbType.SelectedIndex = PublicClass.ToInt32(dt.Rows[0]["limbType"], -1); memo_limbInjury.Text = dt.Rows[0]["limbInjury"].ToString(); #endregion } } } private void simpleButton1_Click(object sender, EventArgs e) { SpecialityCheckUpDTO dto = new SpecialityCheckUpDTO(); List list = new List(); dto.PatientGUID = _patientGuid; dto.SpecialityCheckUp = new SpecialityCheckUp(); dto.SpecialityCheckUp.GUID = guid1; dto.SpecialityCheckUp.PatientGUID = _patientGuid; #region 4.专科检查 dto.SpecialityCheckUp.BrainType = radioGroup_BrainType.SelectedIndex; dto.SpecialityCheckUp.BranInjury = memo_BrainInjury.Text.ToString(); dto.SpecialityCheckUp.MaxillofacialType = radioGroup_MaxillofacialType.TabIndex; dto.SpecialityCheckUp.MaxillofacialInjury = memo_MaxillofacialInjury.Text.ToString(); dto.SpecialityCheckUp.ChestType = radioGroup_ChestType.SelectedIndex; dto.SpecialityCheckUp.ChestInjury = memo_ChestInjury.Text.ToString(); dto.SpecialityCheckUp.AbdomenType = radioGroup_AbdomenType.SelectedIndex; dto.SpecialityCheckUp.AbdomenInjury = memo_AbdomenInjury.Text.ToString(); dto.SpecialityCheckUp.BackType = radioGroup_BackType.SelectedIndex; dto.SpecialityCheckUp.BackInjury = memo_BackInjury.Text.ToString(); dto.SpecialityCheckUp.SpineType = radioGroup_SpineType.SelectedIndex; dto.SpecialityCheckUp.SpineInjury = memo_SpineInjury.Text.ToString(); dto.SpecialityCheckUp.limbType = radioGroup_limbType.TabIndex; dto.SpecialityCheckUp.limbInjury = memo_limbInjury.Text.ToString(); #endregion list.Add(dto); string Url = string.Empty; Url = "api/service/T_Service_FirstAid_SpecialityCheckUp/UpdateOrInsert"; //初始化两个工厂 ClientFactory httpClient = new HttpClientFactory(); Client client = httpClient.VisitFactory(); if (client.Post(Url, list).Success) { XtraMessageBox.Show("保存成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); Form_EMRInfo info; info = (Form_EMRInfo)this.Owner; info.ParentInfo(_patientGuid); this.Close(); } } private void panel1_Paint(object sender, PaintEventArgs e) { } } }