Esempio n. 1
0
 private void BroadcastExpenseKPI(ErpKPI kpi)
 {
     Clients.All.updateExpenseKPI(kpi);
 }
 public void UpdateKPI(ErpKPI kpi)
 {
     _erpTicker.UpdateKPI(kpi);
 }
Esempio n. 3
0
 private void BroadcastCashFlowKPI(ErpKPI kpi)
 {
     Clients.All.updateCashFlowKPI(kpi);
 }
Esempio n. 4
0
 private void BroadcastSalesKPI(ErpKPI kpi)
 {
     Clients.All.updateSalesKPI(kpi);
 }
Esempio n. 5
0
        private void BroadcastNewKPI(ErpKPI kpi)
        {
            switch (kpi.Channel)
            {
                case "Sales":
                    Clients.All.addSalesKPI(kpi);
                    break;

                case "CashFlow":
                    Clients.All.addCashFlowKPI(kpi);
                    break;

                case "Expense":
                    Clients.All.addExpenseKPI(kpi);
                    break;

                default:
                    break;
            }
        }
Esempio n. 6
0
        private void BroadcastKPI(ErpKPI kpi)
        {
            switch (kpi.Channel)
            {
                case "Sales":
                    BroadcastSalesKPI(kpi);
                    break;

                case "CashFlow":
                    BroadcastCashFlowKPI(kpi);
                    break;

                case "Expense":
                    BroadcastExpenseKPI(kpi);
                    break;

                default:
                    break;
            }
        }
Esempio n. 7
0
/*
        public void UpdateSalesKPI(ErpKPI kpi)
        {
            lock (_updateKPIsLock)
            {
                if (!_updatingKPIs)
                {
                    ErpKPI newKPI;
                    _KPIs.TryGetValue(kpi.Type, out newKPI);
                    newKPI.Amount = kpi.Amount;


                    BroadcastSalesKPI(newKPI);
                }
                _updatingKPIs = false;
            }
        }

        public void UpdateCashFlowKPI(ErpKPI kpi)
        {
            lock (_updateKPIsLock)
            {
                if (!_updatingKPIs)
                {
                    ErpKPI newKPI;
                    _KPIs.TryGetValue(kpi.Type, out newKPI);
                    newKPI.Amount = kpi.Amount;


                    BroadcastCashFlowKPI(newKPI);
                }
                _updatingKPIs = false;
            }
        }
*/
        public void UpdateKPI(ErpKPI kpi)
        {
            lock (_updateKPIsLock)
            {
                if (!_updatingKPIs)
                {
                    ErpKPI newKPI;
                    if (_KPIs.TryGetValue(kpi.Type, out newKPI))
                    {
                        newKPI.Amount = kpi.Amount;
                        BroadcastKPI(newKPI);
                    }
                    else
                    {
                        //add new kpi type
                        newKPI = new ErpKPI { Channel = kpi.Channel, Type = kpi.Type, Amount = 0m };
                        newKPI.Amount = kpi.Amount; //perhaps need to broadcast to Add so javascript can append?
                        _KPIs.TryAdd(newKPI.Type, newKPI);
                        BroadcastNewKPI(newKPI);

                    }

                }
                _updatingKPIs = false;
            }
        }