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) { } } }
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(); } }
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(); } }
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); } }
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); } } }
void INovaAlertServiceCallback.OnTslStatusChanged(int phoneNumberId, eTslStatusType type, eTslStatus result, int?hostClientId) { if (this.TSLController != null) { this.TSLController.OnTslStatusChanged(phoneNumberId, type, result, hostClientId); } }
public virtual void OnTslStatusChanged(int phoneNumberId, eTslStatusType type, eTslStatus result, int?hostClientId) { }