コード例 #1
0
        public CodingIncidentMessage ConvertDispatchedIncidentToCoding(gCAD.Shared.IntegrationContract.DispatchedIncident CADincidentMsg)
        {
            string codingID = _CallOut_CodingService.GetCodingID();

            CodingLocation incidentLocation = new CodingLocation();
            incidentLocation.Name = "N.A. Name";
            //incidentLocation.Name = CADincidentMsg.IncidentLocation.Name;
            incidentLocation.Street = CADincidentMsg.IncidentLocation.Street;
            incidentLocation.Unit = CADincidentMsg.IncidentLocation.Unit;
            incidentLocation.State = CADincidentMsg.IncidentLocation.State;
            incidentLocation.City = CADincidentMsg.IncidentLocation.City;
            incidentLocation.Country = "N.A. Country";
            //incidentLocation.Country = CADincidentMsg.IncidentLocation.Country;
            incidentLocation.PostalCode = CADincidentMsg.IncidentLocation.PostalCode;

            List<CodingUnits> tmpcodingunitList = new List<CodingUnits>();
            foreach (gCAD.Shared.IntegrationContract.DispatchedUnit unit in CADincidentMsg.ListOfUnits)
            {
                CodingUnits newUnit = new CodingUnits();
                newUnit.ID = unit.ID;
                newUnit.Callsign = unit.CallSign;
                newUnit.UnitType = "N.A. Unit Type";
                //newUnit.UnitType = unit.UnitType;
                newUnit.FromStatus = unit.Status;
                newUnit.UnitLocation = unit.Location;
                newUnit.UnitHomeStation = unit.HomeStation;
                newUnit.UnitCurrentStation = unit.CurrentStation;

                tmpcodingunitList.Add(newUnit);
            }

            CodingUnits[] dispatchUnits = tmpcodingunitList.ToArray();

            CodingIncidentMessage codingIncidentMsg = new CodingIncidentMessage();
            codingIncidentMsg.CodingID = codingID;
            codingIncidentMsg.IncidentNo = CADincidentMsg.IncidentNumber;
            codingIncidentMsg.IncidentTitle = "N.A. Incident Title";
            //codingIncidentMsg.IncidentTitle = CADincidentMsg.IncidentTitle;
            codingIncidentMsg.IncidentLocation = incidentLocation;
            codingIncidentMsg.IncidentType = CADincidentMsg.IncidentType;
            codingIncidentMsg.IncidentAlarm = CADincidentMsg.AlarmLevel;
            codingIncidentMsg.IncidentPriority = CADincidentMsg.Priority;
            codingIncidentMsg.DispatchDateTime = CADincidentMsg.DateTime;
            codingIncidentMsg.DispatchUnits = dispatchUnits;

            return codingIncidentMsg;
        }
コード例 #2
0
        private CodingIncidentMessage TestMessageTemplate2()
        {
            string testID = _CallOut_CodingService.GetTestID();
            string testNo = testID;
            string testTitle = this.txtTestMsg.Text; //Test Message

            CodingLocation testlocation = new CodingLocation();
            testlocation.Name = "Test Location";
            testlocation.Street = "Test Address";
            testlocation.Unit = "Test Unit";
            testlocation.State = "Test State";
            testlocation.City = "Test City";
            testlocation.Country = "Test Country";
            testlocation.PostalCode = "123456";

            string testType = "Test Type";
            int testAlarm = 0;
            string testPriority = "0";
            DateTime testDateTime = DateTime.Now;

            CodingUnits testUnit1 = new CodingUnits();
            testUnit1.ID = 123;
            testUnit1.Callsign = "T100";
            testUnit1.UnitType = "Test Unit 1";
            testUnit1.FromStatus = "";
            testUnit1.UnitLocation = "";
            testUnit1.UnitHomeStation = "";
            testUnit1.UnitCurrentStation = "Test";

            CodingUnits testUnit2 = new CodingUnits();
            testUnit1.ID = 456;
            testUnit2.Callsign = "T200";
            testUnit2.UnitType = "Test Unit 2";
            testUnit2.FromStatus = "";
            testUnit2.UnitLocation = "";
            testUnit2.UnitHomeStation = "";
            testUnit2.UnitCurrentStation = "Test";

            CodingUnits testUnit3 = new CodingUnits();
            testUnit3.ID = 123;
            testUnit3.Callsign = "T300";
            testUnit3.UnitType = "Test Unit 3";
            testUnit3.FromStatus = "";
            testUnit3.UnitLocation = "";
            testUnit3.UnitHomeStation = "";
            testUnit3.UnitCurrentStation = "Test";

            CodingUnits testUnit4 = new CodingUnits();
            testUnit4.ID = 456;
            testUnit4.Callsign = "T400";
            testUnit4.UnitType = "Test Unit 4";
            testUnit4.FromStatus = "";
            testUnit4.UnitLocation = "";
            testUnit4.UnitHomeStation = "";
            testUnit4.UnitCurrentStation = "Test";

            CodingUnits[] testUnitList = new CodingUnits[4];
            testUnitList[0] = testUnit1;
            testUnitList[1] = testUnit2;
            testUnitList[2] = testUnit3;
            testUnitList[3] = testUnit4;

            CodingIncidentMessage testIncidentMsg = new CodingIncidentMessage();
            testIncidentMsg.CodingID = testID;
            testIncidentMsg.IncidentNo = testNo;
            testIncidentMsg.IncidentTitle = testTitle;
            testIncidentMsg.IncidentLocation = testlocation;
            testIncidentMsg.IncidentType = testType;
            testIncidentMsg.IncidentAlarm = testAlarm;
            testIncidentMsg.IncidentPriority = testPriority;
            testIncidentMsg.DispatchDateTime = testDateTime;
            testIncidentMsg.DispatchUnits = testUnitList;

            return testIncidentMsg;
        }