//

        // 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);
        }
        //To set up List segment
        public void Setup_Control(ref Special_List <Emergency_Call> xExistingCalls, string xState = "Logged", bool xStateCanChange = false)
        {
            // Setting up the values
            EmergencyCalls            = xExistingCalls;
            EmergencyCalls.ItemAdded += new EventHandler(lstEmergencies_CallUpdateEvent);

            // Setting up the interface
            cmbState.Items.AddRange(new object[] {
                "Not Logged",
                "Logged",
                "Waiting",
                "Accepted",
                "Actioned",
                "Declined"
            });
            cmbState.Enabled = xStateCanChange;


            cmbState.SelectedItem           = xState;
            lstEmergencies.Columns[0].Width = 80;
            lstEmergencies.Columns[1].Width = 80;
            lstEmergencies.Columns[2].Width = 80;
            lstEmergencies.Columns[3].Width = 80;
            lstEmergencies.Columns[4].Width = 80;
            lstEmergencies.Columns[5].Width = lstEmergencies.Width - 80 * 5 - (int)(SystemInformation.VerticalScrollBarWidth * 1.5);
            lstEmergencies.Height           = lstEmergencies.Font.Height * 25;

            // Setting the view segment
            Button btnTemp = new Button();

            btnTemp.Name = "btnSegment" + 3;
            btnTemp.Text = "List";
            Change_Segment(btnTemp, null);
        }
        //


        // CONSTRUCTORS
        //To-setup the view.
        public Emergency_Management_View(bool toDisplay, ref Special_List <Emergency_Call> xECs, ref Special_List <Emergency> xEmergencies, ref Special_List <Response_Team> xRTs, ref Special_List <Dispatch> xDispatch) : this(toDisplay)
        {
            Calls       = xECs;
            Emergencies = xEmergencies;
            RTs         = xRTs;
            dispatch    = xDispatch;
        }
Ejemplo n.º 4
0
        private Special_List <Response_Team> LoadRTs(Special_List <BaseStation> xBSs)
        {
            Special_List <Response_Team> xRTs = new Special_List <Response_Team>();

            Random rnd = new Random();

            for (int a = 0; a < 15; a++)
            {
                xRTs.Add(new Response_Team());
                xRTs[a].SetID(10 + a);
                if (a <= 3)
                {
                    xRTs[a].SetGrade(1);
                }
                else if (a > 3 && a <= 6)
                {
                    xRTs[a].SetGrade(2);
                }
                else if (a > 6 && a < 15)
                {
                    xRTs[a].SetGrade(3);
                }
                xRTs[a].SetShift("they work...");

                xRTs[a].SetBaseStation(xBSs[rnd.Next(3)]);
            }
            return(xRTs);
        }
Ejemplo n.º 5
0
        // CONSTRUCTORS
        //To-setup the view.
        public Main_View(bool toDisplay, ref int xFormsCount, ref Special_List <Patient> xPatients, ref Special_List <Emergency_Call> xECs, ref Special_List <Response_Team> xRTs) : this(toDisplay)
        {
            FormsCount            = xFormsCount;
            Patients              = xPatients;
            Patients.ItemAdded   += new EventHandler(GeneratePanels);
            Patients.ItemRemoved += new EventHandler(GeneratePanels);
            ECs              = xECs;
            ECs.ItemAdded   += new EventHandler(GeneratePanels);
            ECs.ItemRemoved += new EventHandler(GeneratePanels);
            RTs              = xRTs;
            RTs.ItemAdded   += new EventHandler(GeneratePanels);
            RTs.ItemRemoved += new EventHandler(GeneratePanels);

            GeneratePanels(null, null);

            SendStatusUpdate(true, "Logged in");


            // TEST DATABASE CONNECTION
            // OleDbConnection cn = new OleDbConnection("DATA SOURCE=oracle.ecn.purdue.edu:1521/master.ecn.purdue.edu;PASSWORD=group1814;USER ID=RESCUE911DB");
            //cn.Open();
            //   OracleConnection cmd1 = new OracleConnection();
            //   cmd1.ConnectionString = "Data Source= oracle.ecn.purdue.edu:1521/master.ecn.purdue.edu;" +
            //        "User Id=rescue911db;" +
            //         "Password = group1814;";
            //   cmd1.Open();

            //  OracleCommand command = cmd1.CreateCommand();
            //   command.CommandText = "desc Operator; ";
            //OracleDataReader odr = command.ExecuteReader();

            //lbDevelopers.Text = (string)odr[0];

            //
        }
        // 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");
                }
            }
        }
Ejemplo n.º 7
0
        public Emergency_Add_View(bool toDisplay, ref Special_List <Emergency_Call> xCalls, ref Emergency_Call xEC, ref Special_List <Caller> xCallers) : this(toDisplay)
        {
            emergencyControl.Setup_Control(ref xCalls, ref xEC);

            emergencyControl.Emergency_Added -= new EventHandler(AddEmer);
            emergencyControl.Emergency_Added += new EventHandler(AddEmer);
        }
        private void SetSegment_List(ref Special_List <Emergency_Call> xEmergencies)
        {
            EnabledControls(false);
            panelList.Enabled     = true;
            pnlParameters.Enabled = true;

            pnlParameters.Visible = true;
            panelList.Visible     = true;
            listEmergenciesPopulate(cboEmergencyType.SelectedText, xEmergencies);
        }
Ejemplo n.º 9
0
        //


        // CONSTRUCTORS
        //To-setup the view.
        public Call_View(bool toDisplay, ref Special_List <Emergency_Call> xECs, ref Special_List <Caller> xCallers) : this(toDisplay)
        {
            callControl.Setup_Control(ref xECs, ref xCallers, 0);

            callControl.AddEmergencyButton_Click -= new EventHandler(AddEmergency_Click);
            callControl.AddEmergencyButton_Click += new EventHandler(AddEmergency_Click);

            callControl.LinkEmergencyButton_Click -= new EventHandler(LinkEmergency_Click);
            callControl.LinkEmergencyButton_Click += new EventHandler(LinkEmergency_Click);
        }
Ejemplo n.º 10
0
 public Patient_Information_View(bool toDisplay, ref Special_List <Patient> xPIs) : this(toDisplay)
 {
     Patients            = xPIs;
     Patients.ItemAdded -= new EventHandler(lstHistory_AddRecord);
     Patients.ItemAdded += new EventHandler(lstHistory_AddRecord);
     foreach (Patient iPatients in Patients)
     {
         lstHistory.Items.Add(iPatients.GetName().ToString());
     }
     tem = Patients.Count + 1;
     txtPatientID.Text = tem.ToString();
 }
Ejemplo n.º 11
0
        // CONSTRUCTORS
        //To-setup the view.
        public Base_Station_Records_View(bool toDisplay, ref Special_List <Base_Station_Records> xBSR) : this(toDisplay)
        {
            BSR = xBSR;

            BSR.ItemAdded -= new EventHandler(lstHistory_AddRecord);
            BSR.ItemAdded += new EventHandler(lstHistory_AddRecord);

            foreach (Base_Station_Records iBSR in BSR)
            {
                lstHistory.Items.Add(iBSR);
            }
        }
Ejemplo n.º 12
0
        //


        public void UpdateSD(ref Shared_Data xSD)
        {
            Calls              = xSD.GetCalls();
            Emergencies        = xSD.GetEmergencies();
            EMTs               = xSD.GetEMTs();
            ResponseTeams      = xSD.GetResponseTeams();
            Dispatches         = xSD.GetDispatches();
            DispatchReports    = xSD.GetDispatchReports();
            BaseStationRecords = xSD.GetBaseStationRecords();
            Patients           = xSD.GetPatients();
            Managers           = xSD.GetManagers();
        }
Ejemplo n.º 13
0
        private Special_List <Supervisor> LoadSupervisors()
        {
            Special_List <Supervisor> xSupervisors = new Special_List <Supervisor>();

            xSupervisors.Add(new Supervisor());
            xSupervisors[0].SetEmployee_ID(3);
            xSupervisors[0].SetName("Chalmers");
            xSupervisors[0].SetLast_Name("Gatecliff");
            xSupervisors[0].SetManager_ID(9);
            xSupervisors[0].SetOperator_ID(12);

            return(xSupervisors);
        }
Ejemplo n.º 14
0
        private Special_List <Patient> LoadPatients()
        {
            Special_List <Patient> xPatients = new Special_List <Patient>();

            xPatients.Add(new Patient());

            xPatients[0].SetDOB("13 feb");
            xPatients[0].setbloodtype("o");
            xPatients[0].setcomplication("Losed Blood");
            xPatients[0].SetName("Calven");
            xPatients[0].SetLast_Name("Yuvenov");
            xPatients[0].setPatientID("1");

            xPatients.Add(new Patient());
            xPatients[1].setbloodtype("o");
            xPatients[1].setcomplication("In pain ");
            xPatients[1].SetName("John");
            xPatients[1].SetLast_Name("Smith");
            xPatients[1].setPatientID("2");
            xPatients.Add(new Patient());
            xPatients[2].SetDOB("2 feb");
            xPatients[2].setbloodtype("o");
            xPatients[2].setcomplication("Losed Blood");
            xPatients[2].SetName("kevin");
            xPatients[2].SetLast_Name("zhang");
            xPatients[2].setPatientID("3");
            xPatients.Add(new Patient());
            xPatients[3].SetDOB("13 feb");
            xPatients[3].setbloodtype("o");
            xPatients[3].setcomplication("Losed Blood");
            xPatients[3].SetName("artem");
            xPatients[3].SetLast_Name("sub");
            xPatients[3].setPatientID("4");
            xPatients.Add(new Patient());
            xPatients[4].SetDOB("13 feb");
            xPatients[4].setbloodtype("o");
            xPatients[4].setcomplication("Losed Blood");
            xPatients[4].SetName("jassica");
            xPatients[4].SetLast_Name("kanban");
            xPatients[4].setPatientID("5");
            xPatients.Add(new Patient());
            xPatients[5].SetDOB("13 feb");
            xPatients[5].setbloodtype("o");
            xPatients[5].setcomplication("Losed Blood");
            xPatients[5].SetName("zoe");
            xPatients[5].SetLast_Name("abbe");
            xPatients[5].setPatientID("6");
            return(xPatients);
        }
Ejemplo n.º 15
0
        private Special_List <EMT> LoadEMTs()
        {
            Special_List <EMT> xEMTs = new Special_List <EMT>();
            int temp  = 0;
            int temp2 = 0;

            for (int a = 0; a < 50; a++)
            {
                xEMTs.Add(new EMT());
                xEMTs[a].SetName("EMT" + a);
                xEMTs[a].SetEmployee_ID(11 + a);
                if (temp > 4)
                {
                    temp = 0; temp2++;
                }

                if (temp == 0)
                {
                    xEMTs[a].SetResponseTeam(ResponseTeams[temp2]);
                    xEMTs[a].SetTeamnumber(temp);
                    temp++;
                }
                else
                {
                    xEMTs[a].SetResponseTeam(ResponseTeams[temp2]);
                    xEMTs[a].SetTeamnumber(temp);
                    temp++;
                }


                if (a < 15)
                {
                    xEMTs[a].setShifttime("15:00");
                    xEMTs[a].SetManager_ID(9);
                }
                else if (a >= 15 && a < 30)
                {
                    xEMTs[a].setShifttime("23:00");
                    xEMTs[a].SetManager_ID(10);
                }
                else if (a >= 30)
                {
                    xEMTs[a].setShifttime("7:00");
                    xEMTs[a].SetManager_ID(9);
                }
            }

            return(xEMTs);
        }
Ejemplo n.º 16
0
        private Special_List <Manager> LoadManagers()
        {
            Special_List <Manager> xManagers = new Special_List <Manager>();

            xManagers.Add(new Manager());
            xManagers[0].SetEmployee_ID(9);
            xManagers[0].SetName("Hughie");
            xManagers[0].SetLast_Name("Diamant");

            xManagers.Add(new Manager());
            xManagers[1].SetEmployee_ID(10);
            xManagers[1].SetName("Vaugh");
            xManagers[1].SetLast_Name("Stairs");

            return(xManagers);
        }
        public void SetResponseTeams_List(ref Special_List <Response_Team> xExistingRTs, int xBS = -1)
        {
            // Setting up the values
            RTs = xExistingRTs;

            RTs.ItemAdded += new EventHandler(lstRTs_RTUpdateEvent);


            // Getting Base Stations
            List <BaseStation> BS = new List <BaseStation>();

            foreach (Response_Team iRT in RTs)
            {
                if (iRT.GetBaseStation() == null)
                {
                    continue;
                }

                if (BS.Contains(iRT.GetBaseStation()) == true)
                {
                    continue;
                }

                BS.Add(iRT.GetBaseStation());
            }


            // Setting up the interface
            if (BS.Count == 0)
            {
                cmbStation.Items.Add("failed to load");
                cmbStation.SelectedItem = "failed to load";
                cmbStation.Enabled      = true;
            }
            else
            {
                cmbStation.Items.AddRange(BS.ToArray());
                xBS = -1;
                cmbStation.SelectedIndex = xBS;
            }

            lstRTs.Columns[0].Width = 100;
            lstRTs.Columns[1].Width = 100;
            lstRTs.Columns[2].Width = 100;
            lstRTs.Columns[3].Width = 100;
            lstRTs.Height           = lstRTs.Font.Height * 25;
        }
        // CONSTRUCTORS
        //To-setup the view.
        public Emergency_Link_View(bool toDisplay, ref Special_List <Emergency> xEmergencies, ref Special_List <Emergency_Call> xECs, Emergency_Call xCurrentCall) :  this(toDisplay)
        {
            Emergencies  = xEmergencies;
            Calls        = xECs;
            Current_Call = xCurrentCall;

            // Call Control set-up.
            callControlOverview.Setup_Control(Current_Call, "Overview", 0);

            // Emergency list set-up.
            if (Emergencies[0] != null)
            {
                emergencyControl.EmergencySelected += new EventHandler(Emergency_List_Item_Selected);

                emergencyControl.Setup_Control(ref Calls, "Logged", true);
            }
        }
Ejemplo n.º 19
0
        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);
        }
Ejemplo n.º 20
0
        private Special_List <Operator> LoadOperators()
        {
            Special_List <Operator> xOperators = new Special_List <Operator>();

            xOperators.Add(new Operator());
            xOperators[0].SetEmployee_ID(1);
            xOperators[0].SetName("Leicester");
            xOperators[0].SetLast_Name("Bosdet");
            xOperators[0].SetManager_ID(9);
            xOperators[0].SetOperator_ID(10);

            xOperators.Add(new Operator());
            xOperators[1].SetEmployee_ID(2);
            xOperators[1].SetName("Fredia");
            xOperators[1].SetLast_Name("Chessill");
            xOperators[1].SetManager_ID(9);
            xOperators[1].SetOperator_ID(11);

            return(xOperators);
        }
Ejemplo n.º 21
0
        private Special_List <Emergency> LoadEmergencies()
        {
            Special_List <Emergency> xEmergencies = new Special_List <Emergency>();

            for (int i = 0; i < 3; i++)
            {
                xEmergencies.Add(new Emergency());
            }

            xEmergencies[0].SetEmergency_ID(100);
            xEmergencies[0].SetEType("Broken bones");

            xEmergencies[1].SetEmergency_ID(101);
            xEmergencies[1].SetEType("Poison");

            xEmergencies[2].SetEmergency_ID(102);
            xEmergencies[2].SetEType("Broken bones");

            return(xEmergencies);
        }
Ejemplo n.º 22
0
        // CONSTRUCTORS
        //To-setup the view.

        public Link_Patient_View(bool toDisplay, ref Special_List <Patient> xLPs) : this(toDisplay)
        {
            LinkPatients = xLPs;

            List <Patient> a = LinkPatients;
            for (int b = 0; b < a.Count(); b++)
            {
                ListViewItem lvi = new ListViewItem(a[b].GetLast_Name() + ", " + a[b].GetName());

                lvi.SubItems.Add(a[b].getSubscribtion().GetSubtitle());
                lvi.SubItems.Add(a[b].getSubscribtion().GetSubscriberMembershipNumber());
                lvi.SubItems.Add(a[b].getSubscribtion().Getprovider().getCompanyId());
                lvi.SubItems.Add(a[b].getSubscribtion().Getprovider().getProviderType());
                lvi.SubItems.Add(b.ToString());
                lstsubs.Items.Add(lvi);
            }
            button1.Enabled = false;
            button3.Enabled = false;
            button2.Enabled = false;
            for (int i = 0; i < a.Count; i++)
            {
                if (a[i].getSubscribtion().GetSubtitle() == "non subscriber")
                {
                    non++;
                }
                if (a[i].getSubscribtion().GetSubtitle() == "Indirec subscriber")
                {
                    indirectsub++;
                }
                if (a[i].getSubscribtion().GetSubtitle() == "subscriber")
                {
                    sub++;
                }
            }
            label7.Text = sub.ToString();
            label9.Text = non.ToString();
            label8.Text = indirectsub.ToString();
            sub         = 0;
            non         = 0;
            indirectsub = 0;
        }
Ejemplo n.º 23
0
        //


        // SETs & GETs
        // To set up any of the Views
        public void Setup_Control(ref Special_List <Emergency_Call> xECs, ref Special_List <Caller> xCallers, int initialSegment)
        {
            // Setting up global data
            EmergencyCalls = xECs;
            Callers        = xCallers;

            // Setting up local data
            Current_Call = new Emergency_Call();
            Current_Call.SetDateTime(DateTime.Now);
            Current_Call.SetState("Not Logged");
            Current_Call.SetTeams_Required(1);
            Current_Call.SetLink_Operator_ID(Current_Operator_ID);
            //

            // Setting the default segment
            Button btnTemp = new Button();

            btnTemp.Name = "btnSegment" + initialSegment;
            //To-Do: change this
            btnTemp.Text = "Add";
            Change_Segment(btnTemp, null);
        }
Ejemplo n.º 24
0
        public Shared_Data()
        {
            MainForms          = new Special_List <Main_Form>();
            Calls              = new Special_List <Emergency_Call>();
            DispatchReports    = new Special_List <Dispatch_Report>();
            BaseStationRecords = new Special_List <Base_Station_Records>();


            Emergencies   = new Special_List <Emergency>();
            EMTs          = new Special_List <EMT>();
            ResponseTeams = new Special_List <Response_Team>();
            Dispatches    = new Special_List <Dispatch>();
            Patients      = new Special_List <Patient>();
            Managers      = new Special_List <Manager>();

            // LOAD PATIENTS
            Patients = LoadPatients();

            // LOAD CALLERS
            Callers = LoadCallers(ref Patients);



            // LOAD OPERATORs, SUPERVISORs AND MANAGERs
            Operators   = LoadOperators();
            Supervisors = LoadSupervisors();
            Managers    = LoadManagers();

            // LOAD EMERGENCIES AND CALLs
            Emergencies  = LoadEmergencies();
            Calls        = LoadEC(Callers, Emergencies);
            BaseStations = LoadBSs();


            // LOAD RTs AND EMTs
            ResponseTeams = LoadRTs(BaseStations);
            EMTs          = LoadEMTs();
        }
Ejemplo n.º 25
0
        private Special_List <BaseStation> LoadBSs()
        {
            Special_List <BaseStation> xBSs = new Special_List <BaseStation>();

            for (int i = 0; i < 3; i++)
            {
                xBSs.Add(new BaseStation());
            }

            xBSs[0].SetBS_ID(1);
            xBSs[0].SetBS_Name("Michaela");
            xBSs[0].SetBS_Location("259 Lighthouse Bay Center");

            xBSs[1].SetBS_ID(2);
            xBSs[1].SetBS_Name("Wenda");
            xBSs[1].SetBS_Location("18 Stephen Court");

            xBSs[2].SetBS_ID(3);
            xBSs[2].SetBS_Name("Corenda");
            xBSs[2].SetBS_Location("28528 Chive Drive");

            return(xBSs);
        }
Ejemplo n.º 26
0
        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);
        }
Ejemplo n.º 27
0
        public void SetEmergency_List(ref Special_List <Emergency_Call> xExistingCalls, string xState = "Logged", bool xStateCanChange = false)
        {
            // Setting up the values
            Calls            = xExistingCalls;
            Calls.ItemAdded += new EventHandler(lstEmergencies_CallUpdateEvent);

            // Setting up the interface
            cmbState.Items.AddRange(new object[] {
                "Logged",
                "Waiting",
                "Accepted",
                "Actioned",
                "Declined"
            });
            cmbState.Enabled                = xStateCanChange;
            cmbState.SelectedItem           = xState;
            lstEmergencies.Columns[0].Width = 80;
            lstEmergencies.Columns[1].Width = 80;
            lstEmergencies.Columns[2].Width = 80;
            lstEmergencies.Columns[3].Width = 80;
            lstEmergencies.Columns[4].Width = 80;
            lstEmergencies.Columns[5].Width = lstEmergencies.Width - 80 * 5 - (int)(SystemInformation.VerticalScrollBarWidth * 1.5);
            lstEmergencies.Height           = lstEmergencies.Font.Height * 25;
        }
 // CONSTRUCTORS
 //To-setup the view.
 public Response_Team_Information_View(bool toDisplay, ref Special_List <Emergency_Call> xCalls, ref Special_List <Emergency> xEmergencies, Special_List <Dispatch> xDispatches) : this(toDisplay)
 {
     Calls       = xCalls;
     Emergencies = xEmergencies;
     Dispatches  = xDispatches;
 }
 // CONSTRUCTORS
 //To setup the view
 public Sub_Payment_View(bool toDisplay, ref Special_List <SubscriberPayment> xSPs) : this(toDisplay)
 {
     SubscriberPayments = xSPs;
 }
Ejemplo n.º 30
0
        // CONSTRUCTORS
        //To-setup the view.
        public EMT_Login_Shift_View(bool toDisplay, ref Special_List <EMT> xEmts, Employee xEmployee) : this(toDisplay)
        {
            if (xEmployee is EMT)
            {
                CurrentEMT = (EMT)xEmployee;
            }
            else
            {
                return;
            }
            timer1.Enabled  = true;
            timer1.Interval = 1000;
            emts            = xEmts.ToArray();
            int    a = int.Parse(CurrentEMT.getshifttime().Split(':')[0]);
            string time;
            if (a - 12 < 0)
            {
                a    = Math.Abs(a);
                time = a.ToString() + ":00 AM";
            }
            else
            {
                a    = a - 12;
                time = a.ToString() + ":00 PM";
            }


            LBshifttime.Text = time;

            int temp1;
            if (int.Parse(DateTime.Now.Hour.ToString()) - int.Parse(CurrentEMT.getshifttime().Split(':')[0]) < 0)
            {
                temp1 = int.Parse(DateTime.Now.Hour.ToString()) + 24 - Math.Abs(int.Parse(CurrentEMT.getshifttime().Split(':')[0]));
            }
            else
            {
                temp1 = int.Parse(DateTime.Now.Hour.ToString()) - int.Parse(CurrentEMT.getshifttime().Split(':')[0]);
            }


            if (CurrentEMT.getstatus() == "STARTED")
            {
                LBtotalworkedhours.Text = CurrentEMT.getTotalShiftTime().ToString().Substring(0, 8);
                lbrt.Text              = CurrentEMT.GetResponseTeam().GetID().ToString();
                labemtid.Text          = CurrentEMT.GetEmployee_ID().ToString();
                lblogtime.Text         = CurrentEMT.getstatus();
                button1.Enabled        = false;
                btnWaitingCall.Enabled = true;
                SendStatusUpdate(true, "You shift started by: " + CurrentEMT.getshiftlogintime(), null);
            }
            else if (temp1 >= 0 && temp1 < 8)
            {
                LBtotalworkedhours.Text = CurrentEMT.getTotalShiftTime().ToString().Substring(0, 8);
                lbrt.Text              = CurrentEMT.GetResponseTeam().GetID().ToString();
                labemtid.Text          = CurrentEMT.GetEmployee_ID().ToString();
                lblogtime.Text         = "READY";
                button1.Enabled        = true;
                btnWaitingCall.Enabled = false;
                SendStatusUpdate(true, "Ready to start the shift", null);
            }
            else
            {
                string b = (DateTime.Now.Hour.ToString());
                LBtotalworkedhours.Text = CurrentEMT.getTotalShiftTime().ToString().Substring(0, 8);
                lbrt.Text              = CurrentEMT.GetResponseTeam().GetID().ToString();
                labemtid.Text          = CurrentEMT.GetEmployee_ID().ToString();
                lblogtime.Text         = "NOT READY";
                btnWaitingCall.Enabled = false;
                button1.Enabled        = false;
                SendStatusUpdate(true, "It is not your shift time Yet", "urgent");
            }
        }