Example #1
0
        public void AbonentsConnectedEventHandler(object sender, RingEventArgs e)
        {
            var senderClient   = _data.Clients.GetEntityOrDefault(c => c.Phone == e.Sender);
            var receiverClient = _data.Clients.GetEntityOrDefault(c => c.Phone == e.Reciver);

            var billing = new Data.Billing(senderClient, receiverClient, DateTimeOffset.Now);

            _currentRings.Add((sender: e.Sender, reciver: e.Reciver), billing);
        }
Example #2
0
        public ExchangeBilling(BillingUnitOfWork data, TimeSpan callReceivingDelay, uint balanceCheckDayNumb = 1, double balanceCountIntervalSeconds = 30)
        {
            this._data = data;
            this.CallReceivingDelay = callReceivingDelay;

            this._balanceCheck = new BalanceCheck(_data.Clients, _data.Billing, TimeSpan.FromSeconds(balanceCountIntervalSeconds));
            _balanceCheck.SetControlDay(balanceCheckDayNumb);

            this._currentRings = new Dictionary <(Phone sender, Phone reciver), Data.Billing>();
        }