Пример #1
0
        public void Go(FogEventToSOPMessage Message)
        {
            ScaleSOP();

            _sopActiveStepIndex = 0;
            var client = new ServiceLayerReference.ServiceLayerClient();
            bool isArabic = Utility.GetLang() == "ar";
            sopViewModel.EventDetailsList = new System.Collections.ObjectModel.ObservableCollection<EventDetailModel>() {
                new EventDetailModel
                {
                    Name = isArabic ? "التاريخ والوقت:" : "Date & Time:",
                    Value = Message.CreatedDate.ToString("dd/MM/yyyy HH:mm")
                }, new EventDetailModel
                {
                    Name = isArabic ? "سبب إنعدام الرؤية:" : "Low Visability Reason:",
                    Value = isArabic ? "ضباب":"Fog"
                }, new EventDetailModel
                {
                    Name = isArabic ? "المكان:" :  "Location:",
                    Value = client.GetAssetLocation((int)Message.TowerId,isArabic)
                } };

            sopViewModel.GetSOP(new SOPGeneralMessage
            {
                MessageId = Message.MessageId,
                GeneralType = SOPSources.Fog,
                OriginalObject = Message,
                NotificationId = Message.NotificationId
            });
        }
Пример #2
0
        public void Go(TruckViolationToSOPMessage message)
        {
            ScaleSOP();
            _sopActiveStepIndex = 0;
            var client = new ServiceLayerReference.ServiceLayerClient();
            bool isArabic = Utility.GetLang() == "ar";
            sopViewModel.EventDetailsList = new System.Collections.ObjectModel.ObservableCollection<EventDetailModel>() {
                new EventDetailModel
                {
                    Name = isArabic ? "التاريخ والوقت" :  "Date & Time",
                    Value = message.CreatedDate.ToString("dd/MM/yyyy HH:mm")
                }, new EventDetailModel
                {
                    Name = isArabic ? "نوع المركبة" :  "Vehicle Type",
                    Value = isArabic ? "شاحنة" : "Truck"
                }, new EventDetailModel
                {
                    Name = Properties.Resources.strPlateNum,
                    Value = message.TruckPlateNumber
                }, new EventDetailModel
                {
                    Name = isArabic ? "المكان" :  "Location",
                    Value = client.GetAssetLocation((int)message.TowerId,isArabic)
                } , new EventDetailModel {
                    Name = isArabic ? "رقم الرادار" :  "Radar Code",
                    Value = client.GetAssetSerialNumber(message.TowerId)
                } };

            var assignedPatrols = sopViewModel.GetAssignedPatrols(message.NotificationId);
            if (assignedPatrols != null && assignedPatrols.Any())
            {
                foreach (var assignedPatrol in assignedPatrols)
                {
                    sopViewModel.EventDetailsList.Add(new EventDetailModel()
                    {
                        Name = isArabic ? "رقم الدورية المدرجة" : "Assigned patrol code",
                        Value = assignedPatrol.PatrolCode
                    });
                }
            }
            sopViewModel.GetSOP(new SOPGeneralMessage
            {
                MessageId = message.MessageId,
                GeneralType = SOPSources.TruckViolation,
                OriginalObject = new WantedCarToSOPMessage
                {
                    CreatedDate = message.CreatedDate,
                    Discription = message.Discription,
                    Latitude = message.Latitude,
                    Longitude = message.Longitude,
                    MessageId = message.MessageId,
                    NotificationId = message.NotificationId,
                    TowerId = message.TowerId,
                    VehiclePlateNumber = message.TruckPlateNumber
                },
                NotificationId = message.NotificationId
            });
        }
Пример #3
0
        public void Go(WantedCarToSOPMessage Message)
        {
            ScaleSOP();

            ScaleGridBasicInfo();

            _sopActiveStepIndex = 0;
            var client = new ServiceLayerReference.ServiceLayerClient();
            bool isArabic = Utility.GetLang() == "ar";
            long messageId = 0;
            string type = isArabic ? Message.Discription : Message.EnglishDiscription;
            if (long.TryParse(Message.MessageId, out messageId))
            {
                var ruleDTO = client.GetMessageBusinessRule(messageId);
                if (ruleDTO != null)
                {
                    type = ruleDTO.BusinessName;
                }
            }
            sopViewModel.EventDetailsList = new System.Collections.ObjectModel.ObservableCollection<EventDetailModel>() {
                new EventDetailModel
                {
                    Name = isArabic ? "نوع المخالفة" :  "Violation Type",
                    Value = type
                }, new EventDetailModel
                {
                    Name =  isArabic ? "التاريخ والوقت" :  "Date & Time",
                    Value = Message.CreatedDate.ToString("dd/MM/yyyy HH:mm")
                }, new EventDetailModel
                {
                    Name = isArabic ? "نوع المركبة" :  "Vehicle Type",
                    Value = isArabic ? "سيارة":"Car"
                }, new EventDetailModel
                {
                    Name = Properties.Resources.strPlateNum,
                    Value = Message.VehiclePlateNumber
                }, new EventDetailModel
                {
                    Name = isArabic ? "المكان" :  "Location",
                    Value = client.GetAssetLocation((int)Message.TowerId,isArabic)
                } , new EventDetailModel {
                    Name = isArabic ? "رقم الرادار" :  "Radar Code",
                    Value = client.GetAssetSerialNumber(Message.TowerId)
                } };

            var assignedPatrols = sopViewModel.GetAssignedPatrols(Message.NotificationId);
            if (assignedPatrols != null && assignedPatrols.Any())
            {
                foreach (var assignedPatrol in assignedPatrols)
                {
                    sopViewModel.EventDetailsList.Add(new EventDetailModel()
                    {
                        Name = isArabic ? "رقم الدورية المدرجة" : "Assigned patrol code",
                        Value = assignedPatrol.PatrolCode
                    });
                }
            }
            sopViewModel.GetSOP(new SOPGeneralMessage
            {
                MessageId = Message.MessageId,
                GeneralType = SOPSources.WantedCar,
                OriginalObject = Message,
                NotificationId = Message.NotificationId
            });
        }