void NotifyTslStatusChanged(int phoneNumberId, eTslStatusType type, eTslStatus status, int?hostClientId = null)
        {
            var clients = _resources.GetActiveClients();

            foreach (var client in  clients)
            {
                try
                {
                    client.Callback.OnTslStatusChanged(phoneNumberId, type, status, hostClientId);
                }
                catch (Exception ex)
                {
                }
            }
        }
Esempio n. 2
0
 public void UpdateStatus(int phoneNumberId, eTslStatusType type, eTslStatus status)
 {
     using (var ctx = new NovaAlertContext())
     {
         var st = new TslStatusDb()
         {
             CreatedDate   = DateTime.Now,
             PhoneNumberId = phoneNumberId,
             Type          = (byte)type,
             Status        = (byte)status
         };
         ctx.TslStatusDbs.Add(st);
         ctx.SaveChanges();
     }
 }
Esempio n. 3
0
 public void UpdateTslStatus(int phoneNumberId, eTslStatusType type, eTslStatus status)
 {
     try
     {
         if (CheckConnection() == false)
         {
             throw new ServiceException();
         }
         _realProxy.UpdateTslStatus(phoneNumberId, type, status);
     }
     catch (Exception ex)
     {
         OnException(ex);
         throw new ServiceException();
     }
 }
Esempio n. 4
0
        string GetStatusText(eTslStatus status)
        {
            switch (status)
            {
            case eTslStatus.InProgress:
                return("Đang kết nối");

            case eTslStatus.Ready:
                return("Đã CBNL");

            case eTslStatus.CanNotConnected:
                return("Không kết nối");

            case eTslStatus.NotResponsed:
                return("Không phản hồi");

            case eTslStatus.Canceled:
                return("Hủy thao tác");

            default:
                return(null);
            }
        }
Esempio n. 5
0
 public TSL_ALertUnitPhoneViewModel(UnitPhone phone)
     : base(phone)
 {
     _prepareStatus = eTslStatus.None;
     _resultStatus  = eTslStatus.None;
 }
        void INovaAlertService.UpdateTslStatus(int phoneNumberId, eTslStatusType type, eTslStatus status)
        {
            TslRepository.Instance.UpdateStatus(phoneNumberId, type, status);
            var client = GetClient();

            NotifyTslStatusChanged(phoneNumberId, type, status, client.Id);
        }
        public override void OnTslStatusChanged(int phoneNumberId, eTslStatusType type, eTslStatus result, int?hostClientId)
        {
            var unit = this.ClientApp.GetUnits(u => u.PhoneNumberId == phoneNumberId)
                       .OfType <TSL_ALertUnitPhoneViewModel>().FirstOrDefault();

            if (unit != null)
            {
                if (type == eTslStatusType.Prepare)
                {
                    unit.PrepareStatus = result;
                }
                else
                {
                    unit.ResultStatus = result;
                }
            }

            if (hostClientId == this.ClientApp.ClientId)
            {
                lock (this)
                {
                    Monitor.PulseAll(this);
                }
            }
        }
Esempio n. 8
0
 void INovaAlertServiceCallback.OnTslStatusChanged(int phoneNumberId, eTslStatusType type, eTslStatus result, int?hostClientId)
 {
     if (this.TSLController != null)
     {
         this.TSLController.OnTslStatusChanged(phoneNumberId, type, result, hostClientId);
     }
 }
Esempio n. 9
0
 public virtual void OnTslStatusChanged(int phoneNumberId, eTslStatusType type, eTslStatus result, int?hostClientId)
 {
 }