// // SETs & GETs //To set up Add segment public void Setup_Control(ref Special_List <Emergency_Call> xCalls, ref Emergency_Call xEC) { EmergencyCalls = xCalls; Current_Call = xEC; Current_Emergency = new Emergency(); // Generating a unique Emergency ID int tempID = 0; for (int a = 0; a < EmergencyCalls.Count; a++) { if (EmergencyCalls[a].GetEmergency().GetEmergency_ID() >= tempID) { tempID = xCalls[a].GetEmergency().GetEmergency_ID(); } } Current_Emergency.SetEmergency_ID(tempID + 1); txtEmergencyID.Text = Current_Emergency.GetEmergency_ID().ToString(); callControlView.Setup_Control(Current_Call, "Overview", 0); // Setting the view segment Button btnTemp = new Button(); btnTemp.Name = "btnSegment" + 0; btnTemp.Text = "Add"; Change_Segment(btnTemp, null); }
private void PopulateFields(Emergency xEmergency) { txtEmergencyID.Text = xEmergency.GetEmergency_ID().ToString(); if (xEmergency.GetEType() != string.Empty) { cboEmergencyType.SelectedItem = xEmergency.GetEType(); } }
// If a team approves an emergency. private void rbYes_CheckedChanged(object sender, EventArgs e) { SD.Emergencies[int.Parse(lstEmergencies.SelectedItems[0].Text)].GetLinkedCalls()[0].SetState("Accepted"); ((Login_Form)SD.LoginForm).UpdateSD(SD); lstEmergencies.Items[emergencySelected].SubItems[2].Text = SD.Emergencies[int.Parse(lstEmergencies.SelectedItems[0].Text)].GetLinkedCalls()[0].GetState(); foreach (Emergency_Management_Form CWF in CWFs) { for (int i = 0; i < CWF.GetLstEmergencies().Items.Count; i++) { if (CWF.GetLstEmergencies().Items[i].Text == Emergency.GetEmergency_ID().ToString()) { CWF.GetLstEmergencies().Items[i].SubItems[2].Text = SD.Emergencies[int.Parse(lstEmergencies.SelectedItems[0].Text)].GetLinkedCalls()[0].GetState(); } } } lstEmergencies.Enabled = false; rbYes.Enabled = false; rbNo.Enabled = false; }