Exemplo n.º 1
0
        private void Process(string phoneNumber)
        {
            if (CustomerType != null)
            {
                var popupName = GetSettings().PopupName;
                if (string.IsNullOrWhiteSpace(popupName))
                {
                    popupName = Name;
                }
                var sr = _entityService.SearchEntities(CustomerType, phoneNumber, "");
                if (sr.Count == 1)
                {
                    var entity = sr.First();
                    InteractionService.UserIntraction.DisplayPopup(popupName, CustomerType.GetFormattedDisplayName(entity.Name, entity),
                                                                   entity.Name + " " + Resources.Calling + ".\r" +
                                                                   entity.SearchString + "\r", "DarkRed", OnClick, phoneNumber);
                }
                else
                {
                    InteractionService.UserIntraction.DisplayPopup(popupName, phoneNumber,
                                                                   phoneNumber + " " + Resources.Calling + "...", "DarkRed",
                                                                   OnClick, phoneNumber);
                }
            }

            _applicationState.NotifyEvent(RuleEventNames.DeviceEventGenerated,
                                          new { DeviceName = Name, EventName = "CID_Event", EventData = phoneNumber });
        }