// FUNCTIONAL METHODS public void SetSegments(string Labels) { lbPreview.Visible = false; string[] labelsFetched = Labels.Split('/'); Controls.Clear(); SegmentsBtns.Clear(); for (int i = 0; i < labelsFetched.Length; i++) { SegmentsBtns.AddItem(new Button()); SegmentsBtns[i].FlatStyle = System.Windows.Forms.FlatStyle.Flat; SegmentsBtns[i].Font = new System.Drawing.Font("Franklin Gothic Medium", 9.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); SegmentsBtns[i].UseVisualStyleBackColor = false; SegmentsBtns[i].FlatAppearance.BorderColor = Color.Gainsboro; SegmentsBtns[i].FlatAppearance.MouseDownBackColor = System.Drawing.Color.WhiteSmoke; SegmentsBtns[i].FlatAppearance.MouseOverBackColor = System.Drawing.Color.WhiteSmoke; SegmentsBtns[i].ForeColor = ColourHighlight; SegmentsBtns[i].Name = "btnSegment" + i; SegmentsBtns[i].Text = labelsFetched[i]; SegmentsBtns[i].Size = new Size(SegmentWidth, this.Height); SegmentsBtns[i].Left = (int)((double)this.Width / labelsFetched.Length) * i; SegmentsBtns[i].Click -= (sender, e) => { }; SegmentsBtns[i].Click += (sender, e) => { SegmentBtn_Click?.Invoke(sender, e); }; } }
// CONSTRUCTORS //To-setup the view. public Dispatch_Related_Times_View(bool toDisplay, ref Special_List <Dispatch> xDispatchs, ref Special_List <Emergency_Call> xcalls) : this(toDisplay) { Dispatchs = xDispatchs; foreach (Dispatch idispatch in Dispatchs) { Emgergency.AddItem(idispatch.GetEmergency()); } if (Emgergency != null) { if (Dispatchs.Count != 0) { emergencyControl.EmergencySelected += new EventHandler(Emergency_List_Item_Selected); emergencyControl.Setup_Control(ref xcalls, "Accepted", false); } else { panel1.Visible = false; emergencyControl.Visible = false; SendStatusUpdate(true, "No data available"); } } }
private void rbYes_CheckedChanged(object sender, EventArgs e) { // SD.AddDispatch(xDispatch); mSelectedCall.SetState("Waiting"); mSelectedRT.SetStatusByDispatch("Waiting For Dispatch"); dis.SetEmergency(mSelectedCall.GetEmergency()); dis.SetResponseTeam(mSelectedRT); dis.SetStatus("Waiting For Dispatch"); dispatch.AddItem(dis); rbYes.Checked = false; SendStatusUpdate(true, "Dispatch Created", "success"); }
// private void btnRecord_Click(object sender, EventArgs e) { if (lstHistory.SelectedIndex != -1) { dateTimePicker1.Value = DateTime.Now; txtRecords.Text = string.Empty; dateTimePicker1.Enabled = true; txtRecords.Enabled = true; lstHistory.SelectedIndex = -1; } if (txtRecords.Text == "") { MessageBox.Show("Enter records.", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); txtRecords.Focus(); return; } if (dateTimePicker1.Text == "") { MessageBox.Show("Enter a Date.", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else //All checks are satisfied { dateTimePicker1.Enabled = false; txtRecords.Enabled = false; Base_Station_Records BaseStationRecord = new Base_Station_Records(); BaseStationRecord.SetRecord(txtRecords.Text); BaseStationRecord.SetDate(dateTimePicker1.Value); BSR.AddItem(BaseStationRecord); lstHistory.SelectedIndex = lstHistory.Items.IndexOf(BaseStationRecord); SendStatusUpdate(true, "Record Saved!", "success"); } }
private Special_List <Emergency_Call> LoadEC(Special_List <Caller> xCallers, Special_List <Emergency> xEmergencies) { // EMERGENCY CALLS TEST DATA Special_List <Emergency_Call> xECs = new Special_List <Emergency_Call>(); for (int i = 0; i < 4; i++) { xECs.AddItem(new Emergency_Call()); xECs[i].SetEmergency_Caller(xCallers[i]); } xECs[0].SetDateTime(DateTime.Parse("10/24/2017 7:10:24 AM", System.Globalization.CultureInfo.InvariantCulture)); xECs[0].SetAddress("102 N Chauncey Ave, West-Lafayette"); xECs[0].SetPriority(3); xECs[0].SetTeams_Required(1); xECs[0].SetDescription("The man got hit by a big snow flake."); xECs[0].SetState("Logged"); xECs[0].SetEmergency(xEmergencies[0]); xECs[1].SetDateTime(DateTime.Parse("10/23/2017 10:14:59 AM", System.Globalization.CultureInfo.InvariantCulture)); xECs[1].SetPriority(2); xECs[1].SetTeams_Required(1); xECs[1].SetAddress("1198 Third Street, West-Lafayette"); xECs[1].SetDescription("The man got attacked by a huge spider on his balcony."); xECs[1].SetState("Logged"); xECs[1].SetEmergency(xEmergencies[1]); xECs[2].SetDateTime(DateTime.Parse("10/23/2017 11:48:23 AM", System.Globalization.CultureInfo.InvariantCulture)); xECs[2].SetPriority(1); xECs[2].SetTeams_Required(2); xECs[2].SetAddress("600 E. Grand Avenue, Navy Pier, Chicago"); xECs[2].SetDescription("An incident regarding a banana slip."); xECs[2].SetState("Logged"); xECs[2].SetEmergency(xEmergencies[2]); xECs[3].SetDateTime(DateTime.Parse("10/23/2017 5:11:00 AM", System.Globalization.CultureInfo.InvariantCulture)); xECs[3].SetPriority(3); xECs[3].SetTeams_Required(1); xECs[3].SetAddress("1600 Amphitheatre Parkway, Mountain View"); xECs[3].SetDescription("The man was run over by a cyclist. Cyclyst needs help."); xECs[3].SetState("Logged"); xECs[3].SetEmergency(xEmergencies[0]); return(xECs); }
// // FUNCTIONAL METHODS private bool CheckFields() { // Existence checks if (Current_Call.GetPriority() == 0) { cboCallPriority.Focus(); return(false); } else if (Current_Call.GetEmergency_Caller().GetPhone_Number() == null) { txtPhoneNumber.Focus(); return(false); } else if (Current_Call.GetEmergency_Caller().GetName() == null) { txtCallerName.Focus(); return(false); } else if (Current_Call.GetAddress() == null) { txtAddress.Focus(); return(false); } else if (Current_Call.GetDescription() == null) { txtDescription.Focus(); return(false); } else { // All checks are satisfied Current_Call.SetTeams_Required((int)numTeams.Value); Current_Call.SetLandmark(txtLandmark.Text); Current_Call.SetLink_Operator_ID(Current_Operator_ID); //Update the Shared Data values regarding the Calls. EmergencyCalls.AddItem(Current_Call); return(true); } }
private Special_List <Caller> LoadCallers(ref Special_List <Patient> xPatients) { // CALLERS TEST DATA Special_List <Caller> ECallers = new Special_List <Caller>(); for (int i = 0; i < 8; i++) { ECallers.AddItem(new Caller()); } ECallers[2].SetName("Jordan"); ECallers[2].SetPhone_Number("1111111111"); ECallers[3].SetName("Zeeshan"); ECallers[3].SetPhone_Number("1234567890"); ECallers[0].SetPhone_Number("1231231231"); ECallers[0].SetPatient(xPatients[0]); ECallers[1].SetPhone_Number("3213213211"); ECallers[1].SetPatient(xPatients[2]); ECallers[5].SetPhone_Number("7655864179"); ECallers[5].SetPatient(xPatients[1]); ECallers[4].SetPhone_Number("7655868686"); ECallers[4].SetPatient(xPatients[3]); ECallers[6].SetPhone_Number("7655864179"); ECallers[6].SetPatient(xPatients[4]); ECallers[7].SetPhone_Number("7659079894"); ECallers[7].SetPatient(xPatients[5]); return(ECallers); }
public void AddCall(Emergency_Call xCall) { Calls.AddItem(xCall); }
// To-Do: Delete sets public void AddMain_Form(Main_Form xForm) { MainForms.AddItem(xForm); FormsCount++; }
private void btnSubmit_Click(object sender, EventArgs e) { double Bill; dis.SetStatus("Finished"); dis.GetResponseTeam().SetStatusByDispatch("Available"); // Existence checks if (txtHospital.Text.Trim() == string.Empty) { MessageBox.Show("Enter Hospital", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); txtHospital.Focus(); return; } else if (txtProcedureDetails.Text.Trim() == string.Empty) { MessageBox.Show("Enter Procedure Details", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); txtHospital.Focus(); return; } else if (txtBill.Text.Trim() == string.Empty) { MessageBox.Show("Enter Bill Amount", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); txtBill.Focus(); return; } //Type Check if (double.TryParse(txtBill.Text, out Bill) == false) { MessageBox.Show("Enter a number for Fee.", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); txtBill.Focus(); return; } else // All checks are satisfied { txtHospital.Enabled = false; txtProcedureDetails.Enabled = false; chkVital.Enabled = false; txtBill.Enabled = false; btnSubmit.Visible = false; Dispatch_Report DispatchReport = new Dispatch_Report(); DispatchReport.SetHospital(txtHospital.Text); DispatchReport.SetProcedureDetail(txtProcedureDetails.Text); DispatchReport.SetVitalSign(chkVital.Checked); DispatchReport.SetBill(double.Parse(txtBill.Text)); DispatchReports.AddItem(DispatchReport); SendStatusUpdate(true, "Report Saved!", "success"); } }
private void btnAddRecord_Click(object sender, EventArgs e) { if (lstHistory.SelectedIndex != -1) { // DTPBirthDate.Value = DateTime.Now; txtComplications.Text = string.Empty; // DTPBirthDate.Enabled = true; txtComplications.Enabled = true; lstHistory.SelectedIndex = -1; } // Existence checks if (txtName.Text.Trim() == string.Empty) { MessageBox.Show("Enter Patient Name", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); txtName.Focus(); return; } if (txtGender.Text.Trim() == string.Empty) { MessageBox.Show("Enter Patient Gender", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); txtGender.Focus(); return; } if (txtAddress.Text.Trim() == string.Empty) { MessageBox.Show("Enter Patient Address", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); txtAddress.Focus(); return; } if (txtlastname.Text.Trim() == string.Empty) { MessageBox.Show("Enter Patient Last Name", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); txtlastname.Focus(); return; } if (txtBloodType.Text.Trim() == string.Empty) { MessageBox.Show("Enter Patient Blood Type", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); txtBloodType.Focus(); return; } if (txtDOB.Text.Trim() == string.Empty) { MessageBox.Show("Enter Patient Age", Text, MessageBoxButtons.OK, MessageBoxIcon.Information); txtDOB.Focus(); return; } //Type Check else // All checks are satisfied { // DTPBirthDate.Enabled = false; txtComplications.Enabled = false; Patient pat = new Patient(); pat.SetLast_Name(txtlastname.Text); pat.SetName(txtName.Text); pat.SetDOB(txtDOB.Text); pat.setbloodtype(txtBloodType.Text); pat.setcomplication(txtComplications.Text); pat.setInsuranceID(txtInsuranceID.Text); pat.setPatientID(txtPatientID.Text); pat.setGender(txtGender.Text); pat.SetAddress(txtAddress.Text); bool bol = false; for (int a = 0; a < Patients.Count; a++) { if (Patients[a].GetName() == pat.GetName() && Patients[a].GetLast_Name() == pat.GetLast_Name()) { Patients[a] = pat; bol = true; break; } } if (bol == false) { Patients.AddItem(pat); tem++; } clear(); lstHistory.Items.Clear(); foreach (Patient iPatients in Patients) { lstHistory.Items.Add(iPatients.GetName().ToString()); } lstHistory.SelectedIndex = lstHistory.Items.IndexOf(pat); SendStatusUpdate(true, "Patient Record Added!", "success"); txtPatientID.Text = tem.ToString(); } }