public string GetXML()
        {
            var notificationBox = new MapNotificationPopUpDTO();

            notificationBox.Lat      = Lat;
            notificationBox.Lon      = Lon;
            notificationBox.TypeName = "Violation";
            var tab1 = new TabDTO()
            {
                TabName = "TotalCountsByStatus"
            };

            foreach (var item in TotalsByStatus)
            {
                tab1.Attributes.Add(new TabItemDTO {
                    KeyName = item.VioltionStatusName, ValueName = item.TotalCountOfViolations.ToString()
                });
            }
            var tab2 = new TabDTO()
            {
                TabName = "TotalCountsByType"
            };

            foreach (var item in TotalsByTypes)
            {
                tab2.Attributes.Add(new TabItemDTO {
                    KeyName = item.VioltionTypeName, ValueName = item.TotalCountOfViolations.ToString()
                });
            }
            var tab3 = new TabDTO()
            {
                TabName = "AssetDetails"
            };

            tab3.Attributes.Add(new TabItemDTO {
                KeyName = "AssetName", ValueName = AssetsDetails.AssetName
            });
            tab3.Attributes.Add(new TabItemDTO {
                KeyName = "AssetStatus", ValueName = AssetsDetails.AssetStatus
            });
            tab3.Attributes.Add(new TabItemDTO {
                KeyName = "LastMainteanceDate", ValueName = AssetsDetails.LastMainteanceDate
            });
            tab3.Attributes.Add(new TabItemDTO {
                KeyName = "VendorName", ValueName = AssetsDetails.VendorName
            });
            notificationBox.Tabs.Add(tab1);
            notificationBox.Tabs.Add(tab2);
            notificationBox.Tabs.Add(tab3);
            return(Helper.Serialize(notificationBox));
        }
Exemplo n.º 2
0
        public string GetXML()
        {
            var notificationBox = new MapNotificationPopUpDTO();

            notificationBox.Lat         = Lat;
            notificationBox.Lon         = Lon;
            notificationBox.TypeName    = IncidentType;
            notificationBox.GeneralType = (int)NotificationMessageType.Incident;
            notificationBox.Discription = string.Format("Incident of type {0} at {1}", IncidentType, IncidentAddress);
            var tab = new TabDTO
            {
                TabName = "General"
            };

            tab.Attributes.Add(new TabItemDTO {
                KeyName = "Incident Address", ValueName = IncidentAddress
            });
            tab.Attributes.Add(new TabItemDTO {
                KeyName = "Incident Type", ValueName = IncidentType
            });
            tab.Attributes.Add(new TabItemDTO {
                KeyName = "Assigned Patrol", ValueName = AssignedPatrol
            });

            tab.Attributes.Add(new TabItemDTO {
                KeyName = "Incident Status", ValueName = IncidentStatus
            });
            tab.Attributes.Add(new TabItemDTO {
                KeyName = "Comments", ValueName = Comments
            });
            tab.Attributes.Add(new TabItemDTO {
                KeyName = "Incident Time", ValueName = IncidentTime
            });


            tab.Attributes.Add(new TabItemDTO {
                KeyName = "Dispatching Time", ValueName = DispatchingTime
            });
            tab.Attributes.Add(new TabItemDTO {
                KeyName = "Patrol Arrived", ValueName = PatrolArrived
            });
            tab.Attributes.Add(new TabItemDTO {
                KeyName = "Incident Finish Time", ValueName = IncidentFinishTime
            });

            notificationBox.Tabs.Add(tab);
            return(Helper.Serialize(notificationBox));
        }