using DevExpress.XtraEditors; using HL_FristAidPlatform_DTO; using HL_FristAidPlatform_DTO.Service; using HL_FristAidPlatform_Public; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace HL_FristAidPlatform_Apoplexy { public partial class Form_FirstAidMeasures : XtraForm { string patientGUID = ""; public byte[] ADoctorImageFiles; public byte[] CoagulationReportImage; public byte[] BloodRoutineReportImage; public byte[] LiverAndKidneyFunctionElectrolyteReportImage; public byte[] Electrocardiogram; public T_Service_PatientFASTScoreDTO FASTScoreDto = new T_Service_PatientFASTScoreDTO(); public Form_FirstAidMeasures(string _patientGuid = "") { InitializeComponent(); patientGUID = _patientGuid; Console.WriteLine(patientGUID); } private void Form_FirstAidMeasures_Load(object sender, EventArgs e) { try { string url = string.Format("api/service/T_Service_Apoplexy_FirstAidMeasures/GetByPatientGuidAndEmergencyRoomGUID?patientGuid={0}", patientGUID); FirstAidMeasuresModelDTO temp = DBHelpClass.GetDateModel(url); if (temp != null) { if (!string.IsNullOrEmpty(temp.RapidBloodGlucose + "")) { radioGroup1.EditValue = temp.RapidBloodGlucose + ""; } if (!string.IsNullOrEmpty(temp.UnobstructedAirway + "")) { radioGroup2.EditValue = temp.UnobstructedAirway + ""; } if (!string.IsNullOrEmpty(temp.CardiacMassage + "")) { radioGroup3.EditValue = temp.CardiacMassage + ""; } if (!string.IsNullOrEmpty(temp.ECGMonitoring + "")) { radioGroup4.EditValue = temp.ECGMonitoring + ""; } if (!string.IsNullOrEmpty(temp.OxygenInhalation + "")) { radioGroup5.EditValue = temp.OxygenInhalation + ""; } if (!string.IsNullOrEmpty(temp.RespiratoryAssistance + "")) { radioGroup6.EditValue = temp.RespiratoryAssistance + ""; } if (!string.IsNullOrEmpty(temp.TraumaManagement + "")) { radioGroup7.EditValue = temp.TraumaManagement + ""; } if (!string.IsNullOrEmpty(temp.FractureManagement + "")) { radioGroup8.EditValue = temp.FractureManagement + ""; } if (!string.IsNullOrEmpty(temp.Position + "")) { radioGroup9.EditValue = temp.Position + ""; } if (!string.IsNullOrEmpty(temp.FacialColorLips + "")) { radioGroup10.EditValue = temp.FacialColorLips + ""; } if (!string.IsNullOrEmpty(temp.Pupil + "")) { radioGroup11.EditValue = temp.Pupil + ""; } if (!string.IsNullOrEmpty(temp.Head + "")) { radioGroup12.EditValue = temp.Head + ""; } if (!string.IsNullOrEmpty(temp.Breathe + "")) { radioGroup13.EditValue = temp.Breathe + ""; } if (!string.IsNullOrEmpty(temp.Chest + "")) { radioGroup14.EditValue = temp.Chest + ""; } if (!string.IsNullOrEmpty(temp.AbdominalTenderness + "")) { radioGroup15.EditValue = temp.AbdominalTenderness + ""; } //============================================== if (!string.IsNullOrEmpty(temp.PlannedArrivalHospitalExam + "")) { PublicClass.SetItemChecked(checkedListBoxControl2, PublicClass.ToString(temp.PlannedArrivalHospitalExam, ""), ';'); } if (!string.IsNullOrEmpty(temp.ElectricMembraneRemoval + "")) { textEdit1.EditValue = temp.ElectricMembraneRemoval + ""; } if (!string.IsNullOrEmpty(temp.Others + "")) { textEdit2.EditValue = temp.Others + ""; } if (!string.IsNullOrEmpty(temp.RapidBloodGlucoseValue + "")) { textEdit3.EditValue = temp.RapidBloodGlucoseValue + ""; } if (!string.IsNullOrEmpty(temp.PupilLeft + "")) { textEdit4.EditValue = temp.PupilLeft + ""; } if (!string.IsNullOrEmpty(temp.PupilRight + "")) { textEdit5.EditValue = temp.PupilRight + ""; } if (!string.IsNullOrEmpty(temp.FastScore + "")) { textEdit6.EditValue = temp.FastScore + ""; } if (!string.IsNullOrEmpty(temp.RatingOrNot + "")) { radioGroup16.EditValue = temp.RatingOrNot + ""; } if (!string.IsNullOrEmpty(temp.LaboratoryDoctor + "")) { textEdit7.EditValue = temp.LaboratoryDoctor + ""; } if (!string.IsNullOrEmpty(temp.ECGExaminationResults + "")) { memoEdit1.EditValue = temp.ECGExaminationResults + ""; } if (!string.IsNullOrEmpty(temp.OnSiteAndEnRouteMedicationSituation + "")) { memoEdit2.EditValue = temp.OnSiteAndEnRouteMedicationSituation + ""; } if (!string.IsNullOrEmpty(temp.VenousPathwayTime + "")) { timeControl1.TimeValue = temp.VenousPathwayTime + ""; } if (!string.IsNullOrEmpty(temp.BloodCollectionTime + "")) { timeControl2.TimeValue = temp.BloodCollectionTime + ""; } if (!string.IsNullOrEmpty(temp.BloodSampleSubmissionTime + "")) { timeControl3.TimeValue = temp.BloodSampleSubmissionTime + ""; } if (!string.IsNullOrEmpty(temp.DeliveryTimeToTheLaboratory + "")) { timeControl4.TimeValue = temp.DeliveryTimeToTheLaboratory + ""; } if (!string.IsNullOrEmpty(temp.CoagulationRoutineReportTime + "")) { timeControl5.TimeValue = temp.CoagulationRoutineReportTime + ""; } if (!string.IsNullOrEmpty(temp.BloodRoutineReportTime + "")) { timeControl6.TimeValue = temp.BloodRoutineReportTime + ""; } if (!string.IsNullOrEmpty(temp.LiverAndKidneyFunctionElectrolyteReportTime + "")) { timeControl7.TimeValue = temp.LiverAndKidneyFunctionElectrolyteReportTime + ""; } if (!string.IsNullOrEmpty(temp.RapidBloodGlucoseTime + "")) { timeControl8.TimeValue = temp.RapidBloodGlucoseTime + ""; } if (!string.IsNullOrEmpty(temp.ECGExaminationTime + "")) { timeControl9.TimeValue = temp.ECGExaminationTime + ""; } if (!string.IsNullOrEmpty(temp.ECGReportTime + "")) { timeControl10.TimeValue = temp.ECGReportTime + ""; } if (!string.IsNullOrEmpty(temp.ArriveRescueRoomTime + "")) { timeControl11.TimeValue = temp.ArriveRescueRoomTime + ""; } if (!string.IsNullOrEmpty(temp.LeaveRescueRoomTime + "")) { timeControl12.TimeValue = temp.LeaveRescueRoomTime + ""; } if (!string.IsNullOrEmpty(temp.DoctorVisitTime + "")) { timeControl13.TimeValue = temp.DoctorVisitTime + ""; } if (!string.IsNullOrEmpty(temp.StrandedRescueRoomDuration + "")) { labelControl54.Text = temp.StrandedRescueRoomDuration + ""; } //肤色 Skin if (temp.Skin == "正常") { comboBoxEdit2.EditValue = "正常"; } if (temp.Skin == "苍白") { comboBoxEdit2.EditValue = "苍白"; } if (temp.Skin == "紫绀") { comboBoxEdit2.EditValue = "紫绀"; } if (temp.Skin == "黄染") { comboBoxEdit2.EditValue = "黄染"; } if (temp.Skin == "潮红") { comboBoxEdit2.EditValue = "潮红"; } //对光反应 Photoreaction if (temp.Photoreaction == "正常") { comboBoxEdit3.EditValue = "正常"; } if (temp.Photoreaction == "灵敏") { comboBoxEdit3.EditValue = "灵敏"; } if (temp.Photoreaction == "迟钝") { comboBoxEdit3.EditValue = "迟钝"; } if (temp.Photoreaction == "消失") { comboBoxEdit3.EditValue = "消失"; } //肺部呼吸音 PulmonaryBreathSounds if (temp.PulmonaryBreathSounds == "清") { comboBoxEdit4.EditValue = "清"; } if (temp.PulmonaryBreathSounds == "粗糙") { comboBoxEdit4.EditValue = "粗糙"; } if (temp.PulmonaryBreathSounds == "减低") { comboBoxEdit4.EditValue = "减低"; } if (temp.PulmonaryBreathSounds == "消失") { comboBoxEdit4.EditValue = "消失"; } //心率 HeartRate if (temp.HeartRate == "齐") { comboBoxEdit5.EditValue = "齐"; } if (temp.HeartRate == "不齐") { comboBoxEdit5.EditValue = "不齐"; } if (temp.HeartRate == "消失") { comboBoxEdit5.EditValue = "消失"; } //心音 HeartSounds if (temp.HeartSounds == "正常心音") { comboBoxEdit6.EditValue = "正常心音"; } if (temp.HeartSounds == "窦性心动过速") { comboBoxEdit6.EditValue = "窦性心动过速"; } if (temp.HeartSounds == "窦性心动过缓") { comboBoxEdit6.EditValue = "窦性心动过缓"; } if (temp.HeartSounds == "窦性心动不齐") { comboBoxEdit6.EditValue = "窦性心动不齐"; } if (temp.HeartSounds == "第一心音分裂") { comboBoxEdit6.EditValue = "第一心音分裂"; } if (temp.HeartSounds == "第二心音分裂") { comboBoxEdit6.EditValue = "第二心音分裂"; } if (temp.HeartSounds == "第一心音增强") { comboBoxEdit6.EditValue = "第一心音增强"; } if (temp.HeartSounds == "第二心音增强") { comboBoxEdit6.EditValue = "第二心音增强"; } if (temp.HeartSounds == "第一心音减弱") { comboBoxEdit6.EditValue = "第一心音减弱"; } if (temp.HeartSounds == "第二心音减弱") { comboBoxEdit6.EditValue = "第二心音减弱"; } if (temp.HeartSounds == "钟摆律摆胎心严重") { comboBoxEdit6.EditValue = "钟摆律摆胎心严重"; } if (temp.HeartSounds == "早搏") { comboBoxEdit6.EditValue = "早搏"; } if (temp.HeartSounds == "心房颤动") { comboBoxEdit6.EditValue = "心房颤动"; } if (temp.HeartSounds == "生理性杂音") { comboBoxEdit6.EditValue = "生理性杂音"; } if (temp.HeartSounds == "二尖瓣关闭不全") { comboBoxEdit6.EditValue = "二尖瓣关闭不全"; } if (temp.HeartSounds == "二尖瓣狭窄") { comboBoxEdit6.EditValue = "二尖瓣狭窄"; } //腹部 Abdomen if (temp.Abdomen == "软") { comboBoxEdit7.EditValue = "软"; } if (temp.Abdomen == "肌紧张") { comboBoxEdit7.EditValue = "肌紧张"; } //脊柱 Spine if (temp.Spine == "畸形") { comboBoxEdit8.EditValue = "畸形"; } if (temp.Spine == "压痛") { comboBoxEdit8.EditValue = "压痛"; } if (temp.Spine == "活动自如") { comboBoxEdit8.EditValue = "活动自如"; } //四肢 TheFourLimbs if (temp.TheFourLimbs == "正常") { comboBoxEdit9.EditValue = "正常"; } if (temp.TheFourLimbs == "增强") { comboBoxEdit9.EditValue = "增强"; } if (temp.TheFourLimbs == "减弱") { comboBoxEdit9.EditValue = "减弱"; } CoagulationReportImage = temp.CoagulationReportImage; if (temp.CoagulationReportImage != null) { lbl_image.Visible = false; hyperlinklbl_Image.Visible = true; } BloodRoutineReportImage = temp.BloodRoutineReportImage; if (temp.BloodRoutineReportImage != null) { lbl_image1.Visible = false; hyperlinkLabelControl1.Visible = true; } Electrocardiogram = temp.Electrocardiogram; if (temp.Electrocardiogram != null) { lbl_image2.Visible = false; hyperlinkLabelControl2.Visible = true; } LiverAndKidneyFunctionElectrolyteReportImage = temp.LiverAndKidneyFunctionElectrolyteReportImage; if (temp.LiverAndKidneyFunctionElectrolyteReportImage != null) { lbl_image3.Visible = false; hyperlinkLabelControl3.Visible = true; } ADoctorImageFiles = temp.ADoctorImageFiles; if (ADoctorImageFiles != null&& ADoctorImageFiles.Length>0) { MemoryStream ms = new MemoryStream(ADoctorImageFiles); Image img = Image.FromStream(ms); p_ADoctorImageFiles.Image = img; p_ADoctorImageFiles.Visible = true; } else { p_ADoctorImageFiles.Visible = false; } } } catch (Exception ex) { throw ex; } } public void SaveFirstAidMeasures() { try { FirstAidMeasuresModelDTO model = new FirstAidMeasuresModelDTO(); model.PatientGuid = patientGUID; if (string.IsNullOrEmpty(model.CreateID + "")) { model.CreateID = Information.User.ID; } if (radioGroup1.SelectedIndex > -1) model.RapidBloodGlucose = radioGroup1.EditValue + ""; if (radioGroup2.SelectedIndex > -1) model.UnobstructedAirway = radioGroup2.EditValue + ""; if (radioGroup3.SelectedIndex > -1) model.CardiacMassage = radioGroup3.EditValue + ""; if (radioGroup4.SelectedIndex > -1) model.ECGMonitoring = radioGroup4.EditValue + ""; if (radioGroup5.SelectedIndex > -1) model.OxygenInhalation = radioGroup5.EditValue + ""; if (radioGroup6.SelectedIndex > -1) model.RespiratoryAssistance = radioGroup6.EditValue + ""; if (radioGroup7.SelectedIndex > -1) model.TraumaManagement = radioGroup7.EditValue + ""; if (radioGroup8.SelectedIndex > -1) model.FractureManagement = radioGroup8.EditValue + ""; if (radioGroup9.SelectedIndex > -1) model.Position = radioGroup9.EditValue + ""; if (radioGroup10.SelectedIndex > -1) model.FacialColorLips = radioGroup10.EditValue + ""; if (radioGroup11.SelectedIndex > -1) model.Pupil = radioGroup11.EditValue + ""; if (radioGroup12.SelectedIndex > -1) model.Head = radioGroup12.EditValue + ""; if (radioGroup13.SelectedIndex > -1) model.Breathe = radioGroup13.EditValue + ""; if (radioGroup14.SelectedIndex > -1) model.Chest = radioGroup14.EditValue + ""; if (radioGroup15.SelectedIndex > -1) model.AbdominalTenderness = radioGroup15.EditValue + ""; model.VenousPathwayTime = timeControl1.TimeValue + ""; model.BloodCollectionTime = timeControl2.TimeValue + ""; model.BloodSampleSubmissionTime = timeControl3.TimeValue + ""; model.DeliveryTimeToTheLaboratory = timeControl4.TimeValue + ""; model.CoagulationRoutineReportTime = timeControl5.TimeValue + ""; model.BloodRoutineReportTime = timeControl6.TimeValue + ""; model.LiverAndKidneyFunctionElectrolyteReportTime = timeControl7.TimeValue + ""; model.RapidBloodGlucoseTime = timeControl8.TimeValue + ""; model.ECGExaminationTime = timeControl9.TimeValue + ""; model.ECGReportTime = timeControl10.TimeValue + ""; model.ArriveRescueRoomTime = timeControl11.TimeValue + ""; model.LeaveRescueRoomTime = timeControl12.TimeValue + ""; model.DoctorVisitTime = timeControl13.TimeValue + ""; model.ElectricMembraneRemoval = textEdit1.EditValue + ""; model.Others = textEdit2.EditValue + ""; model.RapidBloodGlucoseValue = textEdit3.EditValue + ""; model.PupilLeft = textEdit4.EditValue + ""; model.PupilRight = textEdit5.EditValue + ""; model.RatingOrNot = radioGroup16.EditValue + ""; model.FastScore = textEdit6.EditValue + ""; model.LaboratoryDoctor = textEdit7.EditValue + ""; model.ECGExaminationResults = memoEdit1.EditValue + ""; model.OnSiteAndEnRouteMedicationSituation = memoEdit2.EditValue + ""; model.StrandedRescueRoomDuration = labelControl54.Text + ""; model.CreateTime = DateTime.Now; model.CoagulationReportImage = CoagulationReportImage; model.BloodRoutineReportImage = BloodRoutineReportImage; model.Electrocardiogram = Electrocardiogram; model.LiverAndKidneyFunctionElectrolyteReportImage = LiverAndKidneyFunctionElectrolyteReportImage; model.ADoctorImageFiles = ADoctorImageFiles; //肤色 Skin switch (comboBoxEdit2.EditValue + "") { case "正常": model.Skin = "正常"; break; case "苍白": model.Skin = "苍白"; break; case "紫绀": model.Skin = "紫绀"; break; case "黄染": model.Skin = "黄染"; break; case "潮红": model.Skin = "潮红"; break; } //对光反应 Photoreaction switch (comboBoxEdit3.EditValue + "") { case "正常": model.Photoreaction = "正常"; break; case "灵敏": model.Photoreaction = "灵敏"; break; case "迟钝": model.Photoreaction = "迟钝"; break; case "消失": model.Photoreaction = "消失"; break; } //肺部呼吸音 PulmonaryBreathSounds switch (comboBoxEdit4.EditValue + "") { case "清": model.PulmonaryBreathSounds = "清"; break; case "粗糙": model.PulmonaryBreathSounds = "粗糙"; break; case "减低": model.PulmonaryBreathSounds = "减低"; break; case "消失": model.PulmonaryBreathSounds = "消失"; break; } //心率 HeartRate switch (comboBoxEdit5.EditValue + "") { case "齐": model.HeartRate = "齐"; break; case "不齐": model.HeartRate = "不齐"; break; case "消失": model.HeartRate = "消失"; break; } //心音 HeartSounds switch (comboBoxEdit6.EditValue + "") { case "正常心音": model.HeartSounds = "正常心音"; break; case "窦性心动过速": model.HeartSounds = "窦性心动过速"; break; case "窦性心动过缓": model.HeartSounds = "窦性心动过缓"; break; case "窦性心动不齐": model.HeartSounds = "窦性心动不齐"; break; case "第一心音分裂": model.HeartSounds = "第一心音分裂"; break; case "第二心音分裂": model.HeartSounds = "第二心音分裂"; break; case "第一心音增强": model.HeartSounds = "第一心音增强"; break; case "第二心音增强": model.HeartSounds = "第二心音增强"; break; case "第一心音减弱": model.HeartSounds = "第一心音减弱"; break; case "第二心音减弱": model.HeartSounds = "第二心音减弱"; break; case "钟摆律摆胎心严重": model.HeartSounds = "钟摆律摆胎心严重"; break; case "早搏": model.HeartSounds = "早搏"; break; case "心房颤动": model.HeartSounds = "心房颤动"; break; case "生理性杂音": model.HeartSounds = "生理性杂音"; break; case "二尖瓣关闭不全": model.HeartSounds = "二尖瓣关闭不全"; break; case "二尖瓣狭窄": model.HeartSounds = "二尖瓣狭窄"; break; } //腹部 Abdomen switch (comboBoxEdit7.EditValue + "") { case "软": model.Abdomen = "软"; break; case "肌紧张": model.Abdomen = "肌紧张"; break; } //脊柱 Spine switch (comboBoxEdit8.EditValue + "") { case "畸形": model.Spine = "畸形"; break; case "压痛": model.Spine = "压痛"; break; case "活动自如": model.Spine = "活动自如"; break; } //四肢 TheFourLimbs switch (comboBoxEdit9.EditValue + "") { case "正常": model.TheFourLimbs = "正常"; break; case "增强": model.TheFourLimbs = "增强"; break; case "减弱": model.TheFourLimbs = "减弱"; break; } string SyndromeNumber; string Syndrome; PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl2, ";", out SyndromeNumber,out Syndrome); if (!string.IsNullOrEmpty(SyndromeNumber)) { model.PlannedArrivalHospitalExam = ";" + SyndromeNumber + ";"; } List ListDTO = new List(); string Url = string.Format("api/service/T_Service_Apoplexy_FirstAidMeasures/AddOrUpdateFirstAidMeasures"); ClientFactory httpClient = new HttpClientFactory(); Client client = httpClient.VisitFactory(); ListDTO.Add(model); //访问 ListEntity t = client.Post(Url, ListDTO); if (t.Success) { if (!string.IsNullOrEmpty(t.DataString)) { if (t.DataString.Contains("Success")) { JObject jo = (JObject)JsonConvert.DeserializeObject(t.DataString); string msg = jo["Msg"].ToString(); if (!string.IsNullOrEmpty(msg)) { XtraMessageBox.Show(msg); } } else { string msg1 = t.DataString.Replace("/", "").Replace(@"\", "").Replace("\"", ""); XtraMessageBox.Show(msg1); } } else { XtraMessageBox.Show("保存失败"); } } else { XtraMessageBox.Show("保存失败"); } } catch (Exception ex) { throw ex; } } private void timeControl11_TimeValueChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(timeControl11.TimeValue) && !string.IsNullOrEmpty(timeControl12.TimeValue)) { string Duration = DateDiff(Convert.ToDateTime(timeControl12.TimeValue), Convert.ToDateTime(timeControl11.TimeValue)); labelControl54.Text = Duration; } } private string DateDiff(DateTime DateTime1, DateTime DateTime2) { string dateDiff = null; TimeSpan ts = DateTime1.Subtract(DateTime2); dateDiff = ts.Days.ToString().Trim()+"天"+ts.Hours.ToString().Trim() + "小时" + ts.Minutes.ToString().Trim() + "分钟"; return dateDiff; } private void button1_Click(object sender, EventArgs e) { SaveFirstAidMeasures(); } private void simpleButton1_Click(object sender, EventArgs e) { //Fast评分 string strText = string.Empty; InputDialog_trans.ShowFast(out strText, out FASTScoreDto, 0,patientGUID); if (!string.IsNullOrEmpty(strText)) { textEdit6.Text = strText; } } private void comboBoxEdit9_SelectedIndexChanged(object sender, EventArgs e) { } private void groupBox4_Enter(object sender, EventArgs e) { } private void pictureBox5_Click(object sender, EventArgs e) { byte[] image = Electrocardiogram; if (!string.IsNullOrEmpty(image + "")) { HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow frm = new HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow(image); frm.ShowDialog(); } } private void pictureBox1_Click(object sender, EventArgs e) { byte[] image = ADoctorImageFiles; if (!string.IsNullOrEmpty(image + "")) { HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow frm = new HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow(image); frm.ShowDialog(); } } private void pictureBox2_Click(object sender, EventArgs e) { byte[] image = CoagulationReportImage; if (!string.IsNullOrEmpty(image + "")) { HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow frm = new HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow(image); frm.ShowDialog(); } } private void pictureBox3_Click(object sender, EventArgs e) { byte[] image = BloodRoutineReportImage; if (!string.IsNullOrEmpty(image + "")) { HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow frm = new HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow(image); frm.ShowDialog(); } } private void pictureBox4_Click(object sender, EventArgs e) { byte[] image = LiverAndKidneyFunctionElectrolyteReportImage; if (!string.IsNullOrEmpty(image + "")) { HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow frm = new HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow(image); frm.ShowDialog(); } } private void radioGroup16_SelectedIndexChanged(object sender, EventArgs e) { if (radioGroup16.EditValue + "" == "1") { labelControl57.Visible = true; textEdit6.Visible = true; simpleButton1.Visible = true; } else { labelControl57.Visible = false; textEdit6.Visible = false; simpleButton1.Visible = false; } } private void comboBoxEdit5_SelectedIndexChanged(object sender, EventArgs e) { } //凝血报告 private void simpleButton2_Click(object sender, EventArgs e) { #region OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Image Files(*.JPG;*.PNG;*.JPEG;;*.BMP)|*.JPG;*.PNG;;*.BMP;*.JPEG"; openFileDialog.RestoreDirectory = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { try { int Config109 = PublicClass.ToInt32(PublicClassForDataBase.Config109, 5); string FileName = openFileDialog.FileName; if (PublicClass.GetFileSize(FileName) <= Config109) { FileInfo file = new FileInfo(FileName); Bitmap bitmap = new Bitmap(FileName); string coagulationReportImage = file.Extension; if (coagulationReportImage.ToLower() == ".png") { CoagulationReportImage = Convert.FromBase64String(PublicClass.Png2String(bitmap)); } else { CoagulationReportImage = Convert.FromBase64String(PublicClass.Jpeg2String(bitmap)); } lbl_image.Text = "已上传一份报告,点击保存后可存电子档"; } else { XtraMessageBox.Show("上传图片不符合要求!"); } } catch (Exception ex) { PublicClass.WriteErrorLog(this.Text, "上传凝血报告:\r\n" + ex); } } #endregion } private void hyperlinklbl_Image_Click(object sender, EventArgs e) { byte[] image = CoagulationReportImage; if (image != null && image.Length > 0) { HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow frm = new HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow(image); frm.ShowDialog(); } else MessageBox.Show("未找到图片信息,请重新上传"); } //血常规报告 private void simpleButton3_Click(object sender, EventArgs e) { #region OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Image Files(*.JPG;*.PNG;*.JPEG;;*.BMP)|*.JPG;*.PNG;;*.BMP;*.JPEG"; openFileDialog.RestoreDirectory = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { try { int Config109 = PublicClass.ToInt32(PublicClassForDataBase.Config109, 5); string FileName = openFileDialog.FileName; if (PublicClass.GetFileSize(FileName) <= Config109) { FileInfo file = new FileInfo(FileName); Bitmap bitmap = new Bitmap(FileName); string bloodRoutineReportImage = file.Extension; if (bloodRoutineReportImage.ToLower() == ".png") { BloodRoutineReportImage = Convert.FromBase64String(PublicClass.Png2String(bitmap)); } else { BloodRoutineReportImage = Convert.FromBase64String(PublicClass.Jpeg2String(bitmap)); } lbl_image1.Text = "已上传一份报告,点击保存后可存电子档"; } else { XtraMessageBox.Show("上传图片不符合要求!"); } } catch (Exception ex) { PublicClass.WriteErrorLog(this.Text, "上传血常规报告:\r\n" + ex); } } #endregion } private void hyperlinkLabelControl1_Click(object sender, EventArgs e) { byte[] image = BloodRoutineReportImage; if (image != null && image.Length > 0) { HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow frm = new HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow(image); frm.ShowDialog(); } else MessageBox.Show("未找到图片信息,请重新上传"); } //心电图 private void simpleButton4_Click(object sender, EventArgs e) { #region OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Image Files(*.JPG;*.PNG;*.JPEG;;*.BMP)|*.JPG;*.PNG;;*.BMP;*.JPEG"; openFileDialog.RestoreDirectory = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { try { int Config109 = PublicClass.ToInt32(PublicClassForDataBase.Config109, 5); string FileName = openFileDialog.FileName; if (PublicClass.GetFileSize(FileName) <= Config109) { FileInfo file = new FileInfo(FileName); Bitmap bitmap = new Bitmap(FileName); string electrocardiogram = file.Extension; if (electrocardiogram.ToLower() == ".png") { Electrocardiogram = Convert.FromBase64String(PublicClass.Png2String(bitmap)); } else { Electrocardiogram = Convert.FromBase64String(PublicClass.Jpeg2String(bitmap)); } lbl_image2.Text = "已上传一份心电图,点击保存后可存电子档"; } else { XtraMessageBox.Show("上传图片不符合要求!"); } } catch (Exception ex) { PublicClass.WriteErrorLog(this.Text, "上传心电图:\r\n" + ex); } } #endregion } private void hyperlinkLabelControl2_Click(object sender, EventArgs e) { byte[] image = Electrocardiogram; if (image != null && image.Length > 0) { HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow frm = new HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow(image); frm.ShowDialog(); } else MessageBox.Show("未找到图片信息,请重新上传"); } //电解质报告 private void simpleButton5_Click(object sender, EventArgs e) { #region OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Image Files(*.JPG;*.PNG;*.JPEG;;*.BMP)|*.JPG;*.PNG;;*.BMP;*.JPEG"; openFileDialog.RestoreDirectory = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { try { int Config109 = PublicClass.ToInt32(PublicClassForDataBase.Config109, 5); string FileName = openFileDialog.FileName; if (PublicClass.GetFileSize(FileName) <= Config109) { FileInfo file = new FileInfo(FileName); Bitmap bitmap = new Bitmap(FileName); string liverAndKidneyFunctionElectrolyteReportImage = file.Extension; if (liverAndKidneyFunctionElectrolyteReportImage.ToLower() == ".png") { LiverAndKidneyFunctionElectrolyteReportImage = Convert.FromBase64String(PublicClass.Png2String(bitmap)); } else { LiverAndKidneyFunctionElectrolyteReportImage = Convert.FromBase64String(PublicClass.Jpeg2String(bitmap)); } lbl_image3.Text = "已上传一份报告,点击保存后可存电子档"; } else { XtraMessageBox.Show("上传图片不符合要求!"); } } catch (Exception ex) { PublicClass.WriteErrorLog(this.Text, "上传电解质报告:\r\n" + ex); } } #endregion } private void hyperlinkLabelControl3_Click(object sender, EventArgs e) { byte[] image = LiverAndKidneyFunctionElectrolyteReportImage; if (image != null && image.Length > 0) { HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow frm = new HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow(image); frm.ShowDialog(); } else MessageBox.Show("未找到图片信息,请重新上传"); } private void p_ADoctorImageFiles_Click(object sender, EventArgs e) { byte[] image = ADoctorImageFiles; if (image != null && image.Length > 0) { HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow frm = new HL_FristAidPlatform_MultiSystemPublic.Form_ImageShow(image); frm.ShowDialog(); } } } }