Esempio n. 1
0
        public ErpKpiViewModel UpdateKPI(ErpKpi kpi)
        {
            ObservableCollection<ErpKpiViewModel> list = null;
            ErpKpiViewModel viewKpi = null;

            if (kpi == null)
            {
                return null;
            }

            if (kpi.Channel.Equals("Sales"))
            {
               list = SalesItems; 
            }
            else if (kpi.Channel.Equals("CashFlow"))
            {
                list = CashFlowItems; 
            }
            else if (kpi.Channel.Equals("Expense"))
            {
                list = ExpenseItems; 
            }

            if (list != null)
            {
                foreach (ErpKpiViewModel item in list)
                {
                    if (item.Type.Equals(kpi.Type))
                    {
                        item.Total = kpi.Total.ToString("C");
                        item.NumberOf = kpi.NumberOf.ToString();
                        item.Last = kpi.Last.ToString("C");
                        item.Largest = kpi.Largest.ToString("C");
                        item.Smallest = kpi.Smallest.ToString("C");
                        item.Average = kpi.Average.ToString("C");

                        return item;
                    }
                }

                viewKpi = new ErpKpiViewModel(kpi);

                list.Add(viewKpi);
            }

            return viewKpi;
        }
Esempio n. 2
0
 public ErpKpiViewModel(ErpKpi kpi)
 {
     if (kpi != null)
     {
         _Type = kpi.Type;
         _Channel = kpi.Channel;
         _Total = kpi.Total.ToString("C");
         _NumberOf = kpi.NumberOf.ToString();
         _Last = kpi.Last.ToString("C");
         _Largest = kpi.Largest.ToString("C");
         _Smallest = kpi.Smallest.ToString("C");
         _Average = kpi.Average.ToString("C");
     }
 }
Esempio n. 3
0
        private void SalesList_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            ErpKpi kpi = new ErpKpi();
            kpi.Channel = "Sales";
            kpi.Type = "Orders";
            kpi.Total = 1234.45M;

            OnUpdateKPI(kpi);
            OnAlertUpdate("Sales", "This is a test of some long text to display in the alert banner.");
        }
Esempio n. 4
0
        private async void OnUpdateKPI(ErpKpi kpi)
        {
            UiDispatcher disp = new UiDispatcher(this);
            disp.Item = kpi;

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(disp.OnUpdateItem));
        }