66 lines
2.4 KiB
C#
66 lines
2.4 KiB
C#
using DevExpress.XtraEditors;
|
|
using DevExpress.XtraEditors.Controls;
|
|
using HL_FristAidPlatform_DTO;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Windows.Forms;
|
|
|
|
namespace HL_FristAidPlatform_Public
|
|
{
|
|
public partial class Form_BatchPatient : XtraForm
|
|
{
|
|
public Form_BatchPatient()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Form_BatchPatient_Load(object sender, EventArgs e)
|
|
{
|
|
TriageName();
|
|
}
|
|
|
|
public void TriageName()
|
|
{
|
|
string url = string.Format("api/base/T_Base_AccidentInfo/GetAccidentInfoClass");
|
|
List<AccidentInfoClassModel> list = DBHelpClass.GetList<AccidentInfoClassModel>(url);
|
|
foreach (var item in list)
|
|
{
|
|
RadioGroupItem radioButton = new RadioGroupItem();
|
|
radioButton.Value = item.ID.ToString();
|
|
radioButton.Description = item.Name.ToString();
|
|
radioGroup_TriageName.Properties.Items.Add(radioButton);
|
|
}
|
|
}
|
|
|
|
private void btn_Save_Click(object sender, EventArgs e)
|
|
{
|
|
string url = "api/service/FristAidTran/AddBatchPatient";
|
|
List<EmergencyTriageDTO> list = new List<EmergencyTriageDTO>();
|
|
EmergencyTriageDTO dto = new EmergencyTriageDTO();
|
|
dto.EventName = textEdit_EventName.Text;
|
|
//dto.SystemModuleID = Information.SystemModuleInfo.ID;
|
|
dto.HospitalGuid = Information.Hospital.GUID;
|
|
dto.CreatorID = Information.User.ID;
|
|
if (!string.IsNullOrEmpty(radioGroup_TriageName.EditValue + ""))
|
|
{
|
|
dto.EventID = int.Parse(radioGroup_TriageName.EditValue + "");
|
|
}
|
|
dto.EventNumber = int.Parse(TextEdit_Number.Text);
|
|
dto.Attack_Address = txt_Attack_Address.Text.Trim();
|
|
list.Add(dto);
|
|
//初始化两个工厂
|
|
ClientFactory<EmergencyTriageDTO> httpClient = new HttpClientFactory<EmergencyTriageDTO>();
|
|
Client<EmergencyTriageDTO> client = httpClient.VisitFactory();
|
|
ListEntity<EmergencyTriageDTO> t = client.Post(url, list);
|
|
if (t.Success)
|
|
{
|
|
MessageBox.Show("批量建档成功");
|
|
Close();
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("批量建档失败");
|
|
}
|
|
}
|
|
}
|
|
} |