using DevExpress.Utils; using DevExpress.Utils.Layout; using DevExpress.XtraEditors; using HL_FristAidPlatform_DTO; using HL_FristAidPlatform_Public; using Microsoft.AspNetCore.SignalR.Client; using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Drawing; using System.Threading.Tasks; using System.Windows.Forms; namespace HL_FristAidPlatform_PreHospitalEmergency { public partial class Form_TaskDetailInfo : XtraForm { public string TaskGuid; private int Flag; public int TaskState; public string hospitalGuid; public int type = -1;//清除时间 public int update = -1; private string driverID; private string doctorID; private string nurseID; private TablePanel tab; public DataTable dataTable; //定义一个连接对象 private HubConnection connection; public delegate void TextEventHandler(string strText); public TextEventHandler TextHandler; // public delegate void BottomBarIiemClickEventHandler(object sender, BottomBarIiemEventArgs e); //private event BottomBarIiemClickEventHandler bottomBarConfirmClick; //private event BottomBarIiemClickEventHandler BottomBarClearClick; public Form_TaskDetailInfo(string guid, int flag) { InitializeComponent(); TaskGuid = guid; Flag = flag; if (Flag == 3) { //panel_State.Visible = false; //tablePanel1.Visible = false; //panel_Save.Visible = false; } } private async void Form2_Load(object sender, EventArgs e) { SignalRConnection(); QueryTaskDetail(TaskGuid); GetTaskOfPatientInfoList(); } public async void SignalRConnection() { connection = new HubConnectionBuilder() .WithUrl(ConfigurationManager.AppSettings["WebApiUrl"] + "signalr/chatHub") .Build(); await connection.StartAsync(); connection.Closed += async (error) => { await Task.Delay(new Random().Next(0, 5) * 1000); await connection.StartAsync(); }; } public void QueryTaskDetail(string taskGuid) { string url = string.Format("/api/service/T_Service_FirstAid_AlarmTaskInfo/GetTaskDetail?guid={0}", taskGuid); DataTable dt = DBHelpClass.Get(url); if (dt != null) { if (dt.Rows.Count > 0) { lbl_HospitalName.Text = dt.Rows[0]["HospitalName"].ToString(); lbl_WatingAddress.Text = dt.Rows[0]["WaitingAddress"].ToString(); lbl_WaitingAddress.Text = dt.Rows[0]["WaitingAddress"].ToString(); driverID = dt.Rows[0]["DriverID"].ToString(); doctorID = dt.Rows[0]["DoctorID"].ToString(); nurseID = dt.Rows[0]["NurseID"].ToString(); hospitalGuid = dt.Rows[0]["HospitalGUID"].ToString(); lbl_PlateNumber.Text = dt.Rows[0]["PlateNumber"].ToString(); lbl_DriverName.Text = dt.Rows[0]["DriverName"].ToString(); lbl_DoctorName.Text = dt.Rows[0]["DoctorName"].ToString(); lbl_NurseName.Text = dt.Rows[0]["NurseName"].ToString(); if (dt.Rows[0]["TaskState"].ToString() == "0") { if (!string.IsNullOrEmpty(lbl_DriverName.Text)) { lbl_a.Text = "修改司机"; } else { lbl_a.Text = "选择司机"; } if (!string.IsNullOrEmpty(lbl_DoctorName.Text)) { lbl_b.Text = "修改医生"; } else { lbl_b.Text = "选择医生"; } if (!string.IsNullOrEmpty(lbl_NurseName.Text)) { lbl_c.Text = "修改护士"; } else { lbl_c.Text = "选择护士"; } } else { lbl_a.Visible = false; lbl_b.Visible = false; lbl_c.Visible = false; } lbl_WaitingAddress.Text = dt.Rows[0]["WaitingAddress"].ToString(); lbl_PoliceCall.Text = dt.Rows[0]["PoliceCall"].ToString(); lbl_ChiefComplaint.Text = dt.Rows[0]["ChiefComplaint"].ToString(); lbl_Pathogeny.Text = dt.Rows[0]["Pathogeny"].ToString(); lbl_Name.Text = dt.Rows[0]["Name"].ToString(); lbl_Age.Text = dt.Rows[0]["Age"].ToString(); switch (dt.Rows[0]["Gender"].ToString()) { case "0": lbl_Gender.Text = "未知"; break; case "1": lbl_Gender.Text = "男"; break; case "2": lbl_Gender.Text = "女"; break; } lbl_DispatchNo.Text = dt.Rows[0]["DispatchNo"].ToString(); lbl_Consciousness.Text = dt.Rows[0]["Consciousness"].ToString(); lbl_Address.Text = dt.Rows[0]["Address"].ToString(); lbl_Phone.Text = dt.Rows[0]["Phone"].ToString(); if (!string.IsNullOrEmpty(dt.Rows[0]["ConfirmDatetime"].ToString())) { lbl_ConfirmDatetime.Text = dt.Rows[0]["ConfirmDatetime"].ToString(); lbl_ConfirmDatetime.ForeColor = Color.FromArgb(23, 35, 61); lbl_ConfirmDatetime1.ForeColor = Color.FromArgb(23, 35, 61); p1.Image = Properties.Resources.line1b; } if (!string.IsNullOrEmpty(dt.Rows[0]["DrivingTime"].ToString())) { lbl_DrivingTime1.ForeColor = Color.FromArgb(23, 35, 61); lbl_DrivingTime.ForeColor = Color.FromArgb(23, 35, 61); p2.Image = Properties.Resources.line1b; lbl_DrivingTime.Text = dt.Rows[0]["ConfirmDatetime"].ToString(); } if (!string.IsNullOrEmpty(dt.Rows[0]["ArrivalTime"].ToString())) { lbl_ArrivalTime.Text = dt.Rows[0]["ArrivalTime"].ToString(); lbl_ArrivalTime1.ForeColor = Color.FromArgb(23, 35, 61); lbl_ArrivalTime.ForeColor = Color.FromArgb(23, 35, 61); p3.Image = Properties.Resources.line1b; } if (!string.IsNullOrEmpty(dt.Rows[0]["BoardingTime"].ToString())) { lbl_BoardingTime.Text = dt.Rows[0]["BoardingTime"].ToString(); lbl_BoardingTime1.ForeColor = Color.FromArgb(23, 35, 61); lbl_BoardingTime.ForeColor = Color.FromArgb(23, 35, 61); p4.Image = Properties.Resources.line2b; } if (!string.IsNullOrEmpty(dt.Rows[0]["TransportStartTime"].ToString())) { lbl_TransportStartTime.Text = dt.Rows[0]["TransportStartTime"].ToString(); lbl_TransportStartTime1.ForeColor = Color.FromArgb(23, 35, 61); lbl_TransportStartTime.ForeColor = Color.FromArgb(23, 35, 61); p5.Image = Properties.Resources.line3b; } if (!string.IsNullOrEmpty(dt.Rows[0]["TransportEndTime"].ToString())) { lbl_TransportEndTime.Text = dt.Rows[0]["TransportEndTime"].ToString(); lbl_TransportEndTime1.ForeColor = Color.FromArgb(23, 35, 61); lbl_TransportEndTime.ForeColor = Color.FromArgb(23, 35, 61); p6.Image = Properties.Resources.line3b; } if (!string.IsNullOrEmpty(dt.Rows[0]["ReturnHospitalTime"].ToString())) { lbl_ReturnHospitalTime.Text = dt.Rows[0]["ReturnHospitalTime"].ToString(); lbl_ReturnHospitalTime1.ForeColor = Color.FromArgb(23, 35, 61); lbl_ReturnHospitalTime.ForeColor = Color.FromArgb(23, 35, 61); p7.Image = Properties.Resources.line3b; } if (!string.IsNullOrEmpty(dt.Rows[0]["ArriveHospitalTime"].ToString())) { lbl_ArriveHospitalTime1.ForeColor = Color.FromArgb(23, 35, 61); lbl_ArriveHospitalTime.ForeColor = Color.FromArgb(23, 35, 61); lbl_ArriveHospitalTime.Text = dt.Rows[0]["ArriveHospitalTime"].ToString(); } TaskState = Convert.ToInt32(dt.Rows[0]["TaskState"]); // 0等待任务开始 1 任务开始 2 途中待命 3 站内待命 4 中止任务 5 暂停调用 6 恢复调用 7 任务完成 8 交接完成 switch (Convert.ToInt32(dt.Rows[0]["TaskState"])) { case 0: pi_s0.Image = Properties.Resources.等待接受指令; lbl_s0.ForeColor = Color.Black; break; case 1: pi_s1.Image = Properties.Resources.接受指令; lbl_s1.ForeColor = Color.Black; break; case 2: pi_s2.Image = Properties.Resources.待命2; lbl_s2.ForeColor = Color.Black; break; case 3: pi_s3.Image = Properties.Resources.待命1; lbl_s3.ForeColor = Color.Black; break; case 4: pi_s4.Image = Properties.Resources.中止; lbl_s4.ForeColor = Color.Black; //lbl_reason.Text = "中止原因"; //panel_reason.Visible = true; //memoEdit1.Text = dt.Rows[0]["AbnormalReason"].ToString(); //if (!string.IsNullOrEmpty(memoEdit1.Text)) // simpleButton2.Visible = false; break; case 5: //panel_reason.Visible = true; //lbl_reason.Text = "暂停原因"; //memoEdit1.Text = dt.Rows[0]["SuspendReason"].ToString(); //if (!string.IsNullOrEmpty(memoEdit1.Text)) // simpleButton2.Visible=false; pi_s5.Image = Properties.Resources.暂停; lbl_s5.ForeColor = Color.Black; pi_s0.Enabled = false; pi_s1.Enabled = false; pi_s2.Enabled = false; pi_s3.Enabled = false; pi_s5.Enabled = false; pi_s7.Enabled = false; break; case 6: pi_s6.Image = Properties.Resources.恢复调用; lbl_s6.ForeColor = Color.Black; break; case 7: pi_s7.Image = Properties.Resources.完成任务; simpleButton1.Visible = true; break; } if (!string.IsNullOrEmpty(dt.Rows[0]["ToAddress"].ToString())) { labelControl11.Text = dt.Rows[0]["ToAddress"].ToString(); } } } } /// /// 更新状态 /// /// /// public void UpdateTaskState(int tasksate, string reason) { if (TaskState == 8) { XtraMessageBox.Show("不能修改已交接的任务", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { List list = new List(); AlarmTaskUpdateTaskStateDTO dto = new AlarmTaskUpdateTaskStateDTO(); dto.GUID = TaskGuid; if (tasksate == 0) { lbl_a.Visible = true; lbl_b.Visible = true; lbl_c.Visible = true; } if (tasksate == 5) { dto.Reason = reason; dto.UserId = Information.User.ID; } if (tasksate == 6) { dto.UserId = Information.User.ID; } dto.TaskState = tasksate; list.Add(dto); //初始化两个工厂 ClientFactory httpClient = new HttpClientFactory(); Client client = httpClient.VisitFactory(); string Url = "api/service/T_Service_FirstAid_AlarmTaskInfo/UpdateTaskState"; if (client.Post(Url, list).Success) { switch (tasksate) { case 0: pi_s0.Image = Properties.Resources.等待接受指令; lbl_s0.ForeColor = Color.Black; pi_s1.Image = Properties.Resources.状态; lbl_s1.ForeColor = Color.Gray; pi_s2.Image = Properties.Resources.状态; lbl_s2.ForeColor = Color.Gray; pi_s3.Image = Properties.Resources.状态; lbl_s3.ForeColor = Color.Gray; pi_s4.Image = Properties.Resources.状态; lbl_s4.ForeColor = Color.Gray; pi_s5.Image = Properties.Resources.状态; lbl_s5.ForeColor = Color.Gray; pi_s6.Image = Properties.Resources.状态; lbl_s6.ForeColor = Color.Gray; pi_s7.Image = Properties.Resources.状态; simpleButton1.Visible = false; break; case 1: pi_s0.Image = Properties.Resources.状态; lbl_s0.ForeColor = Color.Gray; pi_s1.Image = Properties.Resources.接受指令; lbl_s1.ForeColor = Color.Black; pi_s2.Image = Properties.Resources.状态; lbl_s2.ForeColor = Color.Gray; pi_s3.Image = Properties.Resources.状态; lbl_s3.ForeColor = Color.Gray; pi_s4.Image = Properties.Resources.状态; lbl_s4.ForeColor = Color.Gray; pi_s5.Image = Properties.Resources.状态; lbl_s5.ForeColor = Color.Gray; pi_s6.Image = Properties.Resources.状态; lbl_s6.ForeColor = Color.Gray; pi_s7.Image = Properties.Resources.状态; simpleButton1.Visible = false; break; case 2: pi_s0.Image = Properties.Resources.状态; lbl_s0.ForeColor = Color.Gray; pi_s1.Image = Properties.Resources.状态; lbl_s1.ForeColor = Color.Gray; pi_s2.Image = Properties.Resources.待命2; lbl_s2.ForeColor = Color.Black; pi_s3.Image = Properties.Resources.状态; lbl_s3.ForeColor = Color.Gray; pi_s4.Image = Properties.Resources.状态; lbl_s4.ForeColor = Color.Gray; pi_s5.Image = Properties.Resources.状态; lbl_s5.ForeColor = Color.Gray; pi_s6.Image = Properties.Resources.状态; lbl_s6.ForeColor = Color.Gray; pi_s7.Image = Properties.Resources.状态; simpleButton1.Visible = false; break; case 3: pi_s0.Image = Properties.Resources.状态; lbl_s0.ForeColor = Color.Gray; pi_s1.Image = Properties.Resources.状态; lbl_s1.ForeColor = Color.Gray; pi_s2.Image = Properties.Resources.状态; lbl_s2.ForeColor = Color.Gray; pi_s3.Image = Properties.Resources.待命1; lbl_s3.ForeColor = Color.Black; pi_s4.Image = Properties.Resources.状态; lbl_s4.ForeColor = Color.Gray; pi_s5.Image = Properties.Resources.状态; lbl_s5.ForeColor = Color.Gray; pi_s6.Image = Properties.Resources.状态; lbl_s6.ForeColor = Color.Gray; pi_s7.Image = Properties.Resources.状态; simpleButton1.Visible = false; break; case 4: pi_s0.Image = Properties.Resources.状态; lbl_s0.ForeColor = Color.Gray; pi_s1.Image = Properties.Resources.状态; lbl_s1.ForeColor = Color.Gray; pi_s2.Image = Properties.Resources.状态; lbl_s2.ForeColor = Color.Gray; pi_s3.Image = Properties.Resources.状态; lbl_s3.ForeColor = Color.Gray; pi_s4.Image = Properties.Resources.暂停; lbl_s4.ForeColor = Color.Black; pi_s5.Image = Properties.Resources.状态; lbl_s5.ForeColor = Color.Gray; pi_s6.Image = Properties.Resources.状态; lbl_s6.ForeColor = Color.Gray; pi_s7.Image = Properties.Resources.状态; simpleButton1.Visible = false; break; case 5: pi_s0.Image = Properties.Resources.状态; pi_s0.Enabled = false; lbl_s0.ForeColor = Color.Gray; pi_s1.Image = Properties.Resources.状态; pi_s1.Enabled = false; lbl_s1.ForeColor = Color.Gray; pi_s2.Image = Properties.Resources.状态; pi_s2.Enabled = false; lbl_s2.ForeColor = Color.Gray; pi_s3.Image = Properties.Resources.状态; pi_s3.Enabled = false; lbl_s3.ForeColor = Color.Gray; pi_s4.Image = Properties.Resources.状态; pi_s4.Enabled = false; lbl_s4.ForeColor = Color.Gray; pi_s5.Image = Properties.Resources.暂停; lbl_s5.ForeColor = Color.Black; pi_s5.Enabled = false; pi_s6.Image = Properties.Resources.状态; lbl_s6.ForeColor = Color.Gray; pi_s7.Image = Properties.Resources.状态; pi_s7.Enabled = false; simpleButton1.Visible = false; break; case 6: pi_s0.Image = Properties.Resources.状态; lbl_s0.ForeColor = Color.Gray; pi_s1.Image = Properties.Resources.状态; lbl_s1.ForeColor = Color.Gray; pi_s2.Image = Properties.Resources.状态; lbl_s2.ForeColor = Color.Gray; pi_s3.Image = Properties.Resources.状态; lbl_s3.ForeColor = Color.Gray; pi_s4.Image = Properties.Resources.状态; lbl_s4.ForeColor = Color.Gray; pi_s5.Image = Properties.Resources.状态; lbl_s5.ForeColor = Color.Gray; pi_s6.Image = Properties.Resources.恢复调用; lbl_s6.ForeColor = Color.Black; pi_s7.Image = Properties.Resources.状态; pi_s0.Enabled = true; pi_s1.Enabled = true; pi_s2.Enabled = true; pi_s3.Enabled = true; pi_s4.Enabled = true; pi_s5.Enabled = true; pi_s6.Enabled = true; pi_s7.Enabled = true; simpleButton1.Visible = false; break; case 7: pi_s0.Image = Properties.Resources.状态; lbl_s0.ForeColor = Color.Gray; pi_s1.Image = Properties.Resources.状态; lbl_s1.ForeColor = Color.Gray; pi_s2.Image = Properties.Resources.状态; lbl_s2.ForeColor = Color.Gray; pi_s3.Image = Properties.Resources.状态; lbl_s3.ForeColor = Color.Gray; pi_s4.Image = Properties.Resources.状态; lbl_s4.ForeColor = Color.Gray; pi_s5.Image = Properties.Resources.状态; lbl_s5.ForeColor = Color.Gray; pi_s6.Image = Properties.Resources.状态; lbl_s6.ForeColor = Color.Gray; pi_s7.Image = Properties.Resources.完成任务; simpleButton1.Visible = true; break; } } } } #region 更新状态 private void pi_s0_Click(object sender, EventArgs e) { TaskState = 0; UpdateTaskState(0, ""); } private void pi_s1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(lbl_DriverName.Text) || string.IsNullOrEmpty(lbl_DoctorName.Text) || string.IsNullOrEmpty(lbl_NurseName.Text)) { XtraMessageBox.Show("请完善出警人员"); return; } TaskState = 1; UpdateTaskState(1, ""); } private void pi_s2_Click(object sender, EventArgs e) { TaskState = 2; UpdateTaskState(2, ""); } private void pi_s6_Click(object sender, EventArgs e) { TaskState = 6; UpdateTaskState(6, ""); } private void pi_s7_Click(object sender, EventArgs e) { TaskState = 7; UpdateTaskState(7, ""); simpleButton1.Visible = true; } #endregion private async void simpleButton1_Click(object sender, EventArgs e) { try { DialogResult dr = XtraMessageBox.Show("确认交接", "", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { List list = new List(); DriverHandoverDTO dto = new DriverHandoverDTO(); dto.TaskGUID = TaskGuid; dto.UserId = Information.User.ID; list.Add(dto); //初始化两个工厂 ClientFactory httpClient = new HttpClientFactory(); Client client = httpClient.VisitFactory(); string Url = "api/service/FristAidTran/HandoverTran"; if (client.Post(Url, list).Success) { XtraMessageBox.Show("交接成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult = DialogResult.OK; if (Flag == 1) { await connection.InvokeAsync("SendMessageToGroupAsync", Information.Hospital.GUID.ToString(), "TaskList"); } else { await connection.InvokeAsync("SendMessageToGroupAsync", Information.Hospital.GUID.ToString(), "AllTaskList"); } Close(); } else { XtraMessageBox.Show("交接失败,请稍后重试!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { return; } } catch (Exception) { throw; } } public void GetTaskOfPatientInfoList() { List list = DBHelpClass.GetList(string.Format("api/service/T_Service_Patient/GetTaskOfPatientInfoList?guid={0}", TaskGuid)); if (list != null && list.Count > 0) { CreateTabPanel(list.Count, list); } } /// /// 创建动态表格 /// /// 数据条数 /// 数据 public void CreateTabPanel(int total, List list) { panel_PatientList.Controls.Clear(); int columnCount = 6; //列数 int rowCount = total;//行数 tab = new TablePanel(); tab.Columns.Clear(); for (int i = 0; i < columnCount; i++) { tab.Columns.Add(new TablePanelColumn(TablePanelEntityStyle.Relative, 50)); } tab.Rows.Clear(); for (int i = 0; i < rowCount; i++) { tab.Rows.Add(new TablePanelRow(TablePanelEntityStyle.Absolute, 25)); } tab.Dock = DockStyle.Top; tab.AutoSize = true; tab.BackColor = Color.White; tab.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; for (int i = 0; i < rowCount; i++)//循环行 { LabelControl lbl1 = new LabelControl(); lbl1.Dock = DockStyle.Fill; lbl1.AutoSizeMode = LabelAutoSizeMode.None; lbl1.Appearance.TextOptions.HAlignment = HorzAlignment.Center; lbl1.ForeColor = Color.FromArgb(81, 90, 110); lbl1.Appearance.Font = new Font("Tahoma", 11); lbl1.Text = list[i].Name; tab.SetCell(lbl1, i, 0); LabelControl lbl2 = new LabelControl(); lbl2.Dock = DockStyle.Fill; lbl2.AutoSizeMode = LabelAutoSizeMode.None; lbl2.Appearance.TextOptions.HAlignment = HorzAlignment.Center; lbl2.ForeColor = Color.FromArgb(81, 90, 110); lbl2.Appearance.Font = new Font("Tahoma", 11); if (list[i].Gender == 0) lbl2.Text = "未知"; if (list[i].Gender == 1) lbl2.Text = "男"; if (list[i].Gender == 2) lbl2.Text = "女"; tab.SetCell(lbl2, i, 1); LabelControl lbl3 = new LabelControl(); lbl3.Dock = DockStyle.Fill; lbl3.AutoSizeMode = LabelAutoSizeMode.None; lbl3.Appearance.TextOptions.HAlignment = HorzAlignment.Center; lbl3.ForeColor = Color.FromArgb(81, 90, 110); lbl3.Appearance.Font = new Font("Tahoma", 11); lbl3.Text = list[i].Age.ToString(); tab.SetCell(lbl3, i, 2); LabelControl lbl4 = new LabelControl(); lbl4.Dock = DockStyle.Fill; lbl4.AutoSizeMode = LabelAutoSizeMode.None; lbl4.Appearance.TextOptions.HAlignment = HorzAlignment.Center; lbl4.ForeColor = Color.FromArgb(81, 90, 110); lbl4.Appearance.Font = new Font("Tahoma", 11); if (string.IsNullOrEmpty(list[i].Killip)) lbl4.Text = "无"; if (list[i].Killip == "1") lbl4.Text = "I级(急危病人)"; if (list[i].Killip == "2") lbl4.Text = "II级(急危病人)"; if (list[i].Killip == "3") lbl4.Text = "III级(急危病人)"; if (list[i].Killip == "4") lbl4.Text = "IV级(急危病人)"; tab.SetCell(lbl4, i, 3); LabelControl lbl5 = new LabelControl(); lbl5.Dock = DockStyle.Fill; lbl5.AutoSizeMode = LabelAutoSizeMode.None; lbl5.Appearance.TextOptions.HAlignment = HorzAlignment.Center; lbl5.ForeColor = Color.FromArgb(81, 90, 110); lbl5.Appearance.Font = new Font("Tahoma", 11); lbl5.Text = list[i].TriageDepartment==null?"无": list[i].TriageDepartment; tab.SetCell(lbl5, i, 4); LabelControl lbl6 = new LabelControl(); lbl6.Dock = DockStyle.Fill; lbl6.AutoSizeMode = LabelAutoSizeMode.None; lbl6.Appearance.TextOptions.HAlignment = HorzAlignment.Center; lbl6.ForeColor = Color.FromArgb(81, 90, 110); lbl6.Appearance.Font = new Font("Tahoma", 11); lbl6.Text = list[i].TriageTime == null ? "无" : list[i].TriageTime; ; tab.SetCell(lbl6, i, 5); tab.Controls.AddRange(new Control[] { lbl1, lbl2, lbl3, lbl4, lbl5, lbl6 }); } panel_PatientList.Controls.Add(tab); } private void Form_TaskDetailInfo_FormClosing(object sender, FormClosingEventArgs e) { if (Flag == 1) { //Form_CurrentTaskInfo info; //info = (Form_CurrentTaskInfo)this.Owner; //info.QueryTaskInfo(Information.Hospital.GUID); //info.GetTotalDrvingCensus(Information.Hospital.GUID); //info.QueryHosptialAmbulanceInfo(Information.Hospital.GUID); } if (Flag == 2) { //Form_CurrentAllTaskInfo alltaks; //alltaks = (Form_CurrentAllTaskInfo)this.Owner; //alltaks.QueryDate(); } } private void pi_s3_Click(object sender, EventArgs e) { TaskState = 3; UpdateTaskState(3, TaskGuid); } private void pi_s4_Click(object sender, EventArgs e) { TaskState = 4; UpdateTaskState(4, TaskGuid); } private void pi_s5_Click(object sender, EventArgs e) { TaskState = 5; UpdateTaskState(5, TaskGuid); } private void labelControl4_Click(object sender, EventArgs e) { Form_PersonList person = new Form_PersonList(0, TaskGuid); person.Owner = this; person.Show(); } private void labelControl15_Click(object sender, EventArgs e) { Form_PersonList person = new Form_PersonList(1, TaskGuid); person.Owner = this; person.Show(); } private void labelControl17_Click(object sender, EventArgs e) { Form_PersonList person = new Form_PersonList(2, TaskGuid); person.Owner = this; person.Show(); } public void UpdateName(int type, string name) { if (type == 0) lbl_DriverName.Text = name; if (type == 1) lbl_DoctorName.Text = name; if (type == 2) lbl_NurseName.Text = name; } private void simpleButton2_Click(object sender, EventArgs e) { if (TaskState == 4) { AbnormalReasonDTO dto = new AbnormalReasonDTO(); List list = new List(); dto.GUID = TaskGuid; list.Add(dto); ClientFactory httpClient = new HttpClientFactory(); Client client = httpClient.VisitFactory(); string Url = "api/service/FristAidTran/UpdateAbnormalReason"; client.Post(Url, list); } if (TaskState == 5) { VehicleCallRunningDTO dto = new VehicleCallRunningDTO(); List list = new List(); dto.TaskGUID = TaskGuid; dto.UserId = Information.User.ID; list.Add(dto); ClientFactory httpClient = new HttpClientFactory(); Client client = httpClient.VisitFactory(); string Url = "api/service/FristAidTran/SaveVehicleCall"; client.Post(Url, list); } } public class AbnormalReasonDTO { public string GUID { get; set; } public string Reason { get; set; } } public class VehicleCallRunningDTO { public string Reason { get; set; } public long UserId { get; set; } public string TaskGUID { get; set; } } } }