787 lines
35 KiB
C#
787 lines
35 KiB
C#
using DevExpress.XtraEditors;
|
|
using HL_FristAidPlatform_DTO;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
|
|
//using HL_FristAidPlatform_Print;
|
|
using System.Windows.Forms;
|
|
|
|
namespace HL_FristAidPlatform_Public
|
|
{
|
|
public partial class Form_EpidemicNotifcation : XtraForm
|
|
{
|
|
public string patientGuid;
|
|
public int flag1;
|
|
public int v1;
|
|
public int v2;
|
|
public int v3;
|
|
public int v4;
|
|
public int v5;
|
|
|
|
public string guid1;
|
|
public string guid2;
|
|
public string guid3;
|
|
public string guid4;
|
|
public string guid5;
|
|
|
|
public string flag;
|
|
public byte[] patientSignature;
|
|
public byte[] signatureDoctor;
|
|
|
|
public Form_EpidemicNotifcation(string _patientGuid, string _flag)
|
|
{
|
|
InitializeComponent();
|
|
patientGuid = _patientGuid;
|
|
flag = _flag;
|
|
}
|
|
|
|
private void Form_EpidemicNotifcation_Load(object sender, EventArgs e)
|
|
{
|
|
if (!string.IsNullOrEmpty(flag))
|
|
panelControl2.Visible = false;
|
|
string Url = string.Format("api/service/T_Service_EpidemicNotification/Get?patientGuid={0}", patientGuid);
|
|
EpidemicNotificationDTO dto = new EpidemicNotificationDTO();
|
|
dto.NucleicAcidLst = new List<NucleicAcidModel>();
|
|
dto = DBHelpClass.GetDateModel<EpidemicNotificationDTO>(Url);
|
|
if (dto != null)
|
|
{
|
|
radioGroup_Question_1.SelectedIndex = int.Parse(dto.Question_1.ToString());
|
|
radioGroup_Question_2.SelectedIndex = int.Parse(dto.Question_2.ToString());
|
|
radioGroup_Question_3.SelectedIndex = int.Parse(dto.Question_3.ToString());
|
|
radioGroup_Question_4.SelectedIndex = int.Parse(dto.Question_4.ToString());
|
|
radioGroup_Question_5.SelectedIndex = int.Parse(dto.Question_5.ToString());
|
|
radioGroup_Question_6.SelectedIndex = int.Parse(dto.Question_6.ToString());
|
|
if (!string.IsNullOrEmpty(dto.HealthCode))
|
|
{
|
|
radioHealthCode.EditValue = dto.HealthCode.ToString();
|
|
}
|
|
|
|
if (dto.PatientSignature != null)
|
|
{
|
|
patientSignature = dto.PatientSignature;
|
|
string ReferringDoctorSignature = Convert.ToBase64String(dto.PatientSignature);
|
|
if (!string.IsNullOrEmpty(ReferringDoctorSignature))
|
|
{
|
|
MemoryStream ms = new MemoryStream(Convert.FromBase64String(ReferringDoctorSignature));
|
|
Image img = Image.FromStream(ms);
|
|
pic_PatientSignature.Image = img;
|
|
}
|
|
}
|
|
if (dto.SignatureDoctor != null)
|
|
{
|
|
signatureDoctor = dto.SignatureDoctor;
|
|
string signature = Convert.ToBase64String(dto.SignatureDoctor);
|
|
if (!string.IsNullOrEmpty(signature))
|
|
{
|
|
MemoryStream ms = new MemoryStream(Convert.FromBase64String(signature));
|
|
Image img = Image.FromStream(ms);
|
|
pic_SignatureDoctor.Image = img;
|
|
}
|
|
}
|
|
comboBox_Relationship.Text = dto.Relationship;
|
|
timeControl_Date.TimeValue = dto.SignatureDate;
|
|
if (dto.NucleicAcidLst.Count == 1)
|
|
{
|
|
guid1 = dto.NucleicAcidLst[0].GUID;
|
|
time1.TimeValue = dto.NucleicAcidLst[0].InspectionTime;
|
|
radioGroup1.SelectedIndex = int.Parse(dto.NucleicAcidLst[0].InspectionResults);
|
|
panelInfo1.Visible = true;
|
|
flag1 = 1;
|
|
}
|
|
if (dto.NucleicAcidLst.Count == 2)
|
|
{
|
|
guid1 = dto.NucleicAcidLst[0].GUID;
|
|
time1.TimeValue = dto.NucleicAcidLst[0].InspectionTime;
|
|
if (!string.IsNullOrEmpty(dto.NucleicAcidLst[0].InspectionResults))
|
|
radioGroup1.SelectedIndex = int.Parse(dto.NucleicAcidLst[0].InspectionResults);
|
|
panelInfo1.Visible = true;
|
|
guid2 = dto.NucleicAcidLst[1].GUID;
|
|
time2.TimeValue = dto.NucleicAcidLst[1].InspectionTime;
|
|
radioGroup2.SelectedIndex = int.Parse(dto.NucleicAcidLst[1].InspectionResults);
|
|
panelInfo2.Visible = true;
|
|
flag1 = 2;
|
|
}
|
|
if (dto.NucleicAcidLst.Count == 3)
|
|
{
|
|
guid1 = dto.NucleicAcidLst[0].GUID;
|
|
time1.TimeValue = dto.NucleicAcidLst[0].InspectionTime;
|
|
radioGroup1.SelectedIndex = int.Parse(dto.NucleicAcidLst[0].InspectionResults);
|
|
panelInfo1.Visible = true;
|
|
guid2 = dto.NucleicAcidLst[1].GUID;
|
|
time2.TimeValue = dto.NucleicAcidLst[1].InspectionTime;
|
|
radioGroup2.SelectedIndex = int.Parse(dto.NucleicAcidLst[1].InspectionResults);
|
|
panelInfo2.Visible = true;
|
|
guid3 = dto.NucleicAcidLst[2].GUID;
|
|
time3.TimeValue = dto.NucleicAcidLst[2].InspectionTime;
|
|
radioGroup3.SelectedIndex = int.Parse(dto.NucleicAcidLst[2].InspectionResults);
|
|
panelInfo3.Visible = true;
|
|
flag1 = 3;
|
|
}
|
|
if (dto.NucleicAcidLst.Count == 4)
|
|
{
|
|
guid1 = dto.NucleicAcidLst[0].GUID;
|
|
time1.TimeValue = dto.NucleicAcidLst[0].InspectionTime;
|
|
radioGroup1.SelectedIndex = int.Parse(dto.NucleicAcidLst[0].InspectionResults);
|
|
panelInfo1.Visible = true;
|
|
guid2 = dto.NucleicAcidLst[1].GUID;
|
|
time2.TimeValue = dto.NucleicAcidLst[1].InspectionTime;
|
|
radioGroup2.SelectedIndex = int.Parse(dto.NucleicAcidLst[1].InspectionResults);
|
|
panelInfo2.Visible = true;
|
|
guid3 = dto.NucleicAcidLst[2].GUID;
|
|
time3.TimeValue = dto.NucleicAcidLst[2].InspectionTime;
|
|
radioGroup3.SelectedIndex = int.Parse(dto.NucleicAcidLst[2].InspectionResults);
|
|
panelInfo3.Visible = true;
|
|
guid4 = dto.NucleicAcidLst[3].GUID;
|
|
time4.TimeValue = dto.NucleicAcidLst[3].InspectionTime;
|
|
radioGroup4.SelectedIndex = int.Parse(dto.NucleicAcidLst[3].InspectionResults);
|
|
panelInfo4.Visible = true;
|
|
flag1 = 4;
|
|
}
|
|
if (dto.NucleicAcidLst.Count == 5)
|
|
{
|
|
guid1 = dto.NucleicAcidLst[0].GUID;
|
|
time1.TimeValue = dto.NucleicAcidLst[0].InspectionTime;
|
|
radioGroup1.SelectedIndex = int.Parse(dto.NucleicAcidLst[0].InspectionResults);
|
|
panelInfo1.Visible = true;
|
|
guid2 = dto.NucleicAcidLst[1].GUID;
|
|
time2.TimeValue = dto.NucleicAcidLst[1].InspectionTime;
|
|
radioGroup2.SelectedIndex = int.Parse(dto.NucleicAcidLst[1].InspectionResults);
|
|
panelInfo2.Visible = true;
|
|
guid3 = dto.NucleicAcidLst[2].GUID;
|
|
time3.TimeValue = dto.NucleicAcidLst[2].InspectionTime;
|
|
radioGroup3.SelectedIndex = int.Parse(dto.NucleicAcidLst[2].InspectionResults);
|
|
panelInfo3.Visible = true;
|
|
guid4 = dto.NucleicAcidLst[3].GUID;
|
|
time4.TimeValue = dto.NucleicAcidLst[3].InspectionTime;
|
|
radioGroup4.SelectedIndex = int.Parse(dto.NucleicAcidLst[3].InspectionResults);
|
|
panelInfo4.Visible = true;
|
|
guid5 = dto.NucleicAcidLst[4].GUID;
|
|
time5.TimeValue = dto.NucleicAcidLst[4].InspectionTime;
|
|
radioGroup5.SelectedIndex = int.Parse(dto.NucleicAcidLst[4].InspectionResults);
|
|
panelInfo5.Visible = true;
|
|
flag1 = 5;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void pictureBox2_Click(object sender, EventArgs e)
|
|
{
|
|
if (flag1 >= 5)
|
|
{
|
|
XtraMessageBox.Show("最多只能添加五条核酸记录");
|
|
return;
|
|
}
|
|
flag1 = flag1 + 1;
|
|
|
|
switch (flag1)
|
|
{
|
|
case 1:
|
|
panelInfo1.Visible = true;
|
|
panelInfo2.Visible = false;
|
|
panelInfo3.Visible = false;
|
|
panelInfo4.Visible = false;
|
|
panelInfo5.Visible = false;
|
|
break;
|
|
|
|
case 2:
|
|
panelInfo1.Visible = true;
|
|
panelInfo2.Visible = true;
|
|
panelInfo3.Visible = false;
|
|
panelInfo4.Visible = false;
|
|
panelInfo5.Visible = false;
|
|
break;
|
|
|
|
case 3:
|
|
panelInfo1.Visible = true;
|
|
panelInfo2.Visible = true;
|
|
panelInfo3.Visible = true;
|
|
panelInfo4.Visible = false;
|
|
panelInfo5.Visible = false;
|
|
break;
|
|
|
|
case 4:
|
|
panelInfo1.Visible = true;
|
|
panelInfo2.Visible = true;
|
|
panelInfo3.Visible = true;
|
|
panelInfo4.Visible = true;
|
|
panelInfo5.Visible = false;
|
|
break;
|
|
|
|
case 5:
|
|
panelInfo1.Visible = true;
|
|
panelInfo2.Visible = true;
|
|
panelInfo3.Visible = true;
|
|
panelInfo4.Visible = true;
|
|
panelInfo5.Visible = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void picture1_Click(object sender, EventArgs e)
|
|
{
|
|
if (!string.IsNullOrEmpty(guid1))
|
|
{
|
|
DialogResult dr = XtraMessageBox.Show("是否删除该条记录", "", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
|
if (dr == DialogResult.Yes)
|
|
{
|
|
try
|
|
{
|
|
List<GUIDDTO> list = new List<GUIDDTO>();
|
|
GUIDDTO dto = new GUIDDTO();
|
|
dto.GUID = guid1;
|
|
string Url = "api/service/T_Service_EpidemicNotification/DeleteInfo";
|
|
list.Add(dto);
|
|
//初始化两个工厂
|
|
ClientFactory<GUIDDTO> httpClient = new HttpClientFactory<GUIDDTO>();
|
|
Client<GUIDDTO> client = httpClient.VisitFactory();
|
|
//访问
|
|
ListEntity<GUIDDTO> t = client.Post(Url, list);
|
|
if (t.Success)
|
|
{
|
|
JObject jo = (JObject)JsonConvert.DeserializeObject(t.DataString);
|
|
string success = jo["Success"].ToString();
|
|
if (success == "True")
|
|
{
|
|
panelInfo1.Visible = false;
|
|
flag1 = flag1 - 1;
|
|
guid1 = "";
|
|
time1.TimeValue = "";
|
|
radioGroup1.SelectedIndex = -1;
|
|
}
|
|
string msg = jo["Msg"].ToString();
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
XtraMessageBox.Show(msg);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("保存失败");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
PublicClass.WriteErrorLog(this.Text, "卒中患者病历审核-通过:\r\n" + ex);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
panelInfo1.Visible = false;
|
|
flag1 = flag1 - 1;
|
|
}
|
|
}
|
|
|
|
private void picture2_Click(object sender, EventArgs e)
|
|
{
|
|
if (!string.IsNullOrEmpty(guid2))
|
|
{
|
|
DialogResult dr = XtraMessageBox.Show("是否删除该条记录", "", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
|
if (dr == DialogResult.Yes)
|
|
{
|
|
try
|
|
{
|
|
List<GUIDDTO> list = new List<GUIDDTO>();
|
|
GUIDDTO dto = new GUIDDTO();
|
|
dto.GUID = guid2;
|
|
string Url = "api/service/T_Service_EpidemicNotification/DeleteInfo";
|
|
list.Add(dto);
|
|
//初始化两个工厂
|
|
ClientFactory<GUIDDTO> httpClient = new HttpClientFactory<GUIDDTO>();
|
|
Client<GUIDDTO> client = httpClient.VisitFactory();
|
|
//访问
|
|
ListEntity<GUIDDTO> t = client.Post(Url, list);
|
|
if (t.Success)
|
|
{
|
|
JObject jo = (JObject)JsonConvert.DeserializeObject(t.DataString);
|
|
string success = jo["Success"].ToString();
|
|
if (success == "True")
|
|
{
|
|
panelInfo2.Visible = false;
|
|
flag1 = flag1 - 1;
|
|
guid2 = "";
|
|
time2.TimeValue = "";
|
|
radioGroup2.SelectedIndex = -1;
|
|
}
|
|
string msg = jo["Msg"].ToString();
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
XtraMessageBox.Show(msg);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("保存失败");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
PublicClass.WriteErrorLog(this.Text, "卒中患者病历审核-通过:\r\n" + ex);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
panelInfo2.Visible = false;
|
|
flag1 = flag1 - 1;
|
|
}
|
|
}
|
|
|
|
private void picture3_Click(object sender, EventArgs e)
|
|
{
|
|
if (!string.IsNullOrEmpty(guid3))
|
|
{
|
|
DialogResult dr = XtraMessageBox.Show("是否删除该条记录", "", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
|
if (dr == DialogResult.Yes)
|
|
{
|
|
try
|
|
{
|
|
List<GUIDDTO> list = new List<GUIDDTO>();
|
|
GUIDDTO dto = new GUIDDTO();
|
|
dto.GUID = guid3;
|
|
string Url = "api/service/T_Service_EpidemicNotification/DeleteInfo";
|
|
list.Add(dto);
|
|
//初始化两个工厂
|
|
ClientFactory<GUIDDTO> httpClient = new HttpClientFactory<GUIDDTO>();
|
|
Client<GUIDDTO> client = httpClient.VisitFactory();
|
|
//访问
|
|
ListEntity<GUIDDTO> t = client.Post(Url, list);
|
|
if (t.Success)
|
|
{
|
|
JObject jo = (JObject)JsonConvert.DeserializeObject(t.DataString);
|
|
string success = jo["Success"].ToString();
|
|
if (success == "True")
|
|
{
|
|
panelInfo3.Visible = false;
|
|
flag1 = flag1 - 1;
|
|
guid3 = "";
|
|
time3.TimeValue = "";
|
|
radioGroup3.SelectedIndex = -1;
|
|
}
|
|
string msg = jo["Msg"].ToString();
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
XtraMessageBox.Show(msg);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("保存失败");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
PublicClass.WriteErrorLog(this.Text, "卒中患者病历审核-通过:\r\n" + ex);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
panelInfo3.Visible = false;
|
|
flag1 = flag1 - 1;
|
|
}
|
|
}
|
|
|
|
private void picture4_Click(object sender, EventArgs e)
|
|
{
|
|
if (!string.IsNullOrEmpty(guid4))
|
|
{
|
|
DialogResult dr = XtraMessageBox.Show("是否删除该条记录", "", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
|
if (dr == DialogResult.Yes)
|
|
{
|
|
try
|
|
{
|
|
List<GUIDDTO> list = new List<GUIDDTO>();
|
|
GUIDDTO dto = new GUIDDTO();
|
|
dto.GUID = guid4;
|
|
string Url = "api/service/T_Service_EpidemicNotification/DeleteInfo";
|
|
list.Add(dto);
|
|
//初始化两个工厂
|
|
ClientFactory<GUIDDTO> httpClient = new HttpClientFactory<GUIDDTO>();
|
|
Client<GUIDDTO> client = httpClient.VisitFactory();
|
|
//访问
|
|
ListEntity<GUIDDTO> t = client.Post(Url, list);
|
|
if (t.Success)
|
|
{
|
|
JObject jo = (JObject)JsonConvert.DeserializeObject(t.DataString);
|
|
string success = jo["Success"].ToString();
|
|
if (success == "True")
|
|
{
|
|
panelInfo4.Visible = false;
|
|
flag1 = flag1 - 1;
|
|
time4.TimeValue = "";
|
|
radioGroup4.SelectedIndex = -1;
|
|
guid4 = "";
|
|
}
|
|
string msg = jo["Msg"].ToString();
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
XtraMessageBox.Show(msg);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("保存失败");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
PublicClass.WriteErrorLog(this.Text, "卒中患者病历审核-通过:\r\n" + ex);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
panelInfo4.Visible = false;
|
|
flag1 = flag1 - 1;
|
|
}
|
|
}
|
|
|
|
private void picture5_Click(object sender, EventArgs e)
|
|
{
|
|
if (!string.IsNullOrEmpty(guid5))
|
|
{
|
|
DialogResult dr = XtraMessageBox.Show("是否删除该条记录", "", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
|
if (dr == DialogResult.Yes)
|
|
{
|
|
try
|
|
{
|
|
List<GUIDDTO> list = new List<GUIDDTO>();
|
|
GUIDDTO dto = new GUIDDTO();
|
|
dto.GUID = guid5;
|
|
string Url = "api/service/T_Service_EpidemicNotification/DeleteInfo";
|
|
list.Add(dto);
|
|
//初始化两个工厂
|
|
ClientFactory<GUIDDTO> httpClient = new HttpClientFactory<GUIDDTO>();
|
|
Client<GUIDDTO> client = httpClient.VisitFactory();
|
|
//访问
|
|
ListEntity<GUIDDTO> t = client.Post(Url, list);
|
|
if (t.Success)
|
|
{
|
|
JObject jo = (JObject)JsonConvert.DeserializeObject(t.DataString);
|
|
string success = jo["Success"].ToString();
|
|
if (success == "True")
|
|
{
|
|
panelInfo5.Visible = false;
|
|
flag1 = flag1 - 1;
|
|
guid5 = "";
|
|
time5.TimeValue = "";
|
|
radioGroup5.SelectedIndex = -1;
|
|
}
|
|
string msg = jo["Msg"].ToString();
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
XtraMessageBox.Show(msg);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("保存失败");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
PublicClass.WriteErrorLog(this.Text, "卒中患者病历审核-通过:\r\n" + ex);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
panelInfo5.Visible = false;
|
|
flag1 = flag1 - 1;
|
|
}
|
|
}
|
|
|
|
private void simpleButton1_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (radioGroup_Question_1.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请把问题填写完整");
|
|
return;
|
|
}
|
|
if (radioGroup_Question_2.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请把问题填写完整");
|
|
return;
|
|
}
|
|
if (radioGroup_Question_3.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请把问题填写完整");
|
|
return;
|
|
}
|
|
if (radioGroup_Question_4.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请把问题填写完整");
|
|
return;
|
|
}
|
|
if (radioGroup_Question_5.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请把问题填写完整");
|
|
return;
|
|
}
|
|
if (radioGroup_Question_6.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请把问题填写完整");
|
|
return;
|
|
}
|
|
if (radioHealthCode.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请选择健康码状态");
|
|
return;
|
|
}
|
|
if (string.IsNullOrEmpty(comboBox_Relationship.Text))
|
|
{
|
|
XtraMessageBox.Show("请填写关系");
|
|
return;
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(timeControl_Date.TimeValue))
|
|
{
|
|
XtraMessageBox.Show("日期不能为空");
|
|
return;
|
|
}
|
|
EpidemicNotificationDTO dto = new EpidemicNotificationDTO();
|
|
dto.NucleicAcidLst = new List<NucleicAcidModel>();
|
|
List<EpidemicNotificationDTO> list = new List<EpidemicNotificationDTO>();
|
|
dto.PatientGUID = patientGuid;
|
|
dto.Question_1 = radioGroup_Question_1.SelectedIndex;
|
|
dto.Question_2 = radioGroup_Question_2.SelectedIndex;
|
|
dto.Question_3 = radioGroup_Question_3.SelectedIndex;
|
|
dto.Question_4 = radioGroup_Question_4.SelectedIndex;
|
|
dto.Question_5 = radioGroup_Question_5.SelectedIndex;
|
|
dto.Question_6 = radioGroup_Question_6.SelectedIndex;
|
|
dto.Relationship = comboBox_Relationship.Text == "请选择" ? "" : comboBox_Relationship.Text;
|
|
dto.SignatureDoctor = signatureDoctor;
|
|
dto.SignatureDate = timeControl_Date.TimeValue;
|
|
if (panelInfo1.Visible == true && !string.IsNullOrEmpty(time1.TimeValue) && radioGroup1.SelectedIndex > -1)
|
|
{
|
|
NucleicAcidModel nucleic = new NucleicAcidModel();
|
|
nucleic.GUID = guid1;
|
|
nucleic.InspectionTime = time1.TimeValue;
|
|
nucleic.InspectionResults = radioGroup1.SelectedIndex.ToString();
|
|
dto.NucleicAcidLst.Add(nucleic);
|
|
}
|
|
if (panelInfo2.Visible == true && !string.IsNullOrEmpty(time2.TimeValue) && radioGroup2.SelectedIndex > -1)
|
|
{
|
|
NucleicAcidModel nucleic = new NucleicAcidModel();
|
|
nucleic.GUID = guid2;
|
|
nucleic.InspectionTime = time2.TimeValue;
|
|
nucleic.InspectionResults = radioGroup2.SelectedIndex.ToString();
|
|
dto.NucleicAcidLst.Add(nucleic);
|
|
}
|
|
if (panelInfo3.Visible == true && !string.IsNullOrEmpty(time3.TimeValue) && radioGroup3.SelectedIndex > -1)
|
|
{
|
|
NucleicAcidModel nucleic = new NucleicAcidModel();
|
|
nucleic.GUID = guid3;
|
|
nucleic.InspectionTime = time3.TimeValue;
|
|
nucleic.InspectionResults = radioGroup3.SelectedIndex.ToString();
|
|
dto.NucleicAcidLst.Add(nucleic);
|
|
}
|
|
if (panelInfo4.Visible == true && !string.IsNullOrEmpty(time4.TimeValue) && radioGroup4.SelectedIndex > -1)
|
|
{
|
|
NucleicAcidModel nucleic = new NucleicAcidModel();
|
|
nucleic.GUID = guid4;
|
|
nucleic.InspectionTime = time4.TimeValue;
|
|
nucleic.InspectionResults = radioGroup4.SelectedIndex.ToString();
|
|
dto.NucleicAcidLst.Add(nucleic);
|
|
}
|
|
if (panelInfo5.Visible == true && !string.IsNullOrEmpty(time5.TimeValue) && radioGroup5.SelectedIndex > -1)
|
|
{
|
|
NucleicAcidModel nucleic = new NucleicAcidModel();
|
|
nucleic.GUID = guid5;
|
|
nucleic.InspectionTime = time5.TimeValue;
|
|
nucleic.InspectionResults = radioGroup5.SelectedIndex.ToString();
|
|
dto.NucleicAcidLst.Add(nucleic);
|
|
}
|
|
dto.PatientSignature = patientSignature;
|
|
if (!string.IsNullOrEmpty(radioHealthCode.EditValue.ToString()) && radioHealthCode.EditValue != null)
|
|
dto.HealthCode = radioHealthCode.EditValue.ToString();
|
|
|
|
list.Add(dto);
|
|
string Url = string.Empty;
|
|
Url = "api/service/T_Service_EpidemicNotification/SaveEpidemicNotification";
|
|
//初始化两个工厂
|
|
ClientFactory<EpidemicNotificationDTO> httpClient = new HttpClientFactory<EpidemicNotificationDTO>();
|
|
Client<EpidemicNotificationDTO> client = httpClient.VisitFactory();
|
|
//访问
|
|
ListEntity<EpidemicNotificationDTO> t = client.Post(Url, list);
|
|
if (t.Success)
|
|
{
|
|
JObject jo = (JObject)JsonConvert.DeserializeObject(t.DataString);
|
|
string msg = jo["Msg"].ToString();
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
XtraMessageBox.Show(msg);
|
|
}
|
|
//this.Close();
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("保存失败");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
public void Save()
|
|
{
|
|
try
|
|
{
|
|
if (radioGroup_Question_1.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请把问题填写完整");
|
|
return;
|
|
}
|
|
if (radioGroup_Question_2.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请把问题填写完整");
|
|
return;
|
|
}
|
|
if (radioGroup_Question_3.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请把问题填写完整");
|
|
return;
|
|
}
|
|
if (radioGroup_Question_4.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请把问题填写完整");
|
|
return;
|
|
}
|
|
if (radioGroup_Question_5.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请把问题填写完整");
|
|
return;
|
|
}
|
|
if (radioGroup_Question_6.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请把问题填写完整");
|
|
return;
|
|
}
|
|
if (radioHealthCode.SelectedIndex == -1)
|
|
{
|
|
XtraMessageBox.Show("请选择健康码状态");
|
|
return;
|
|
}
|
|
if (string.IsNullOrEmpty(comboBox_Relationship.Text))
|
|
{
|
|
XtraMessageBox.Show("请填写关系");
|
|
return;
|
|
}
|
|
if (string.IsNullOrEmpty(timeControl_Date.TimeValue))
|
|
{
|
|
XtraMessageBox.Show("日期不能为空");
|
|
return;
|
|
}
|
|
EpidemicNotificationDTO dto = new EpidemicNotificationDTO();
|
|
dto.NucleicAcidLst = new List<NucleicAcidModel>();
|
|
List<EpidemicNotificationDTO> list = new List<EpidemicNotificationDTO>();
|
|
dto.PatientGUID = patientGuid;
|
|
dto.Question_1 = radioGroup_Question_1.SelectedIndex;
|
|
dto.Question_2 = radioGroup_Question_2.SelectedIndex;
|
|
dto.Question_3 = radioGroup_Question_3.SelectedIndex;
|
|
dto.Question_4 = radioGroup_Question_4.SelectedIndex;
|
|
dto.Question_5 = radioGroup_Question_5.SelectedIndex;
|
|
dto.Question_6 = radioGroup_Question_6.SelectedIndex;
|
|
dto.Relationship = comboBox_Relationship.Text == "请选择" ? "" : comboBox_Relationship.Text;
|
|
dto.SignatureDoctor = signatureDoctor;
|
|
dto.SignatureDate = timeControl_Date.TimeValue;
|
|
if (panelInfo1.Visible == true && !string.IsNullOrEmpty(time1.TimeValue) && radioGroup1.SelectedIndex > -1)
|
|
{
|
|
NucleicAcidModel nucleic = new NucleicAcidModel();
|
|
nucleic.GUID = guid1;
|
|
nucleic.InspectionTime = time1.TimeValue;
|
|
nucleic.InspectionResults = radioGroup1.SelectedIndex.ToString();
|
|
dto.NucleicAcidLst.Add(nucleic);
|
|
}
|
|
if (panelInfo2.Visible == true && !string.IsNullOrEmpty(time2.TimeValue) && radioGroup2.SelectedIndex > -1)
|
|
{
|
|
NucleicAcidModel nucleic = new NucleicAcidModel();
|
|
nucleic.GUID = guid2;
|
|
nucleic.InspectionTime = time2.TimeValue;
|
|
nucleic.InspectionResults = radioGroup2.SelectedIndex.ToString();
|
|
dto.NucleicAcidLst.Add(nucleic);
|
|
}
|
|
if (panelInfo3.Visible == true && !string.IsNullOrEmpty(time3.TimeValue) && radioGroup3.SelectedIndex > -1)
|
|
{
|
|
NucleicAcidModel nucleic = new NucleicAcidModel();
|
|
nucleic.GUID = guid3;
|
|
nucleic.InspectionTime = time3.TimeValue;
|
|
nucleic.InspectionResults = radioGroup3.SelectedIndex.ToString();
|
|
dto.NucleicAcidLst.Add(nucleic);
|
|
}
|
|
if (panelInfo4.Visible == true && !string.IsNullOrEmpty(time4.TimeValue) && radioGroup4.SelectedIndex > -1)
|
|
{
|
|
NucleicAcidModel nucleic = new NucleicAcidModel();
|
|
nucleic.GUID = guid4;
|
|
nucleic.InspectionTime = time4.TimeValue;
|
|
nucleic.InspectionResults = radioGroup4.SelectedIndex.ToString();
|
|
dto.NucleicAcidLst.Add(nucleic);
|
|
}
|
|
if (panelInfo5.Visible == true && !string.IsNullOrEmpty(time5.TimeValue) && radioGroup5.SelectedIndex > -1)
|
|
{
|
|
NucleicAcidModel nucleic = new NucleicAcidModel();
|
|
nucleic.GUID = guid5;
|
|
nucleic.InspectionTime = time5.TimeValue;
|
|
nucleic.InspectionResults = radioGroup5.SelectedIndex.ToString();
|
|
dto.NucleicAcidLst.Add(nucleic);
|
|
}
|
|
|
|
dto.PatientSignature = signatureDoctor;
|
|
if (!string.IsNullOrEmpty(radioHealthCode.EditValue.ToString()) && radioHealthCode.EditValue != null)
|
|
dto.HealthCode = radioHealthCode.EditValue.ToString();
|
|
|
|
list.Add(dto);
|
|
string Url = string.Empty;
|
|
Url = "api/service/T_Service_EpidemicNotification/SaveEpidemicNotification";
|
|
//初始化两个工厂
|
|
ClientFactory<EpidemicNotificationDTO> httpClient = new HttpClientFactory<EpidemicNotificationDTO>();
|
|
Client<EpidemicNotificationDTO> client = httpClient.VisitFactory();
|
|
//访问
|
|
ListEntity<EpidemicNotificationDTO> t = client.Post(Url, list);
|
|
if (t.Success)
|
|
{
|
|
JObject jo = (JObject)JsonConvert.DeserializeObject(t.DataString);
|
|
string msg = jo["Msg"].ToString();
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
XtraMessageBox.Show(msg);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("保存失败");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
private void pictureBox1_Click(object sender, EventArgs e)
|
|
{
|
|
string msg = Print.GetEpidemicNotificationOfPrint(patientGuid, patientSignature, signatureDoctor, true);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
MessageBox.Show(msg);
|
|
}
|
|
|
|
private void pictureBox3_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
|
|
private void panelControl1_Paint(object sender, PaintEventArgs e)
|
|
{
|
|
|
|
}
|
|
}
|
|
} |