Exemplo n.º 1
0
        private void ButtonDeviceOn_Click(object sender, RoutedEventArgs e)
        {
            DataBaseOperations dbo = new DataBaseOperations();

            //devices = new ObservableCollection<DevClass>();
            merenja = new ObservableCollection <Merenje>();
            List <Merenje> ms = new List <Merenje>();

            agregators = new ObservableCollection <Shared.Agregator>();
            List <DevClass>         devs = dbo.LoadDevices();
            List <Shared.Agregator> ags  = new List <Shared.Agregator>();

            foreach (DevClass dc in devs)
            {
                ags = dbo.LoadAgregators();
                ms  = dbo.LoadMerenja();
                devices.Add(dc);
            }
            foreach (Merenje m in ms)
            {
                merenja.Add(m);
            }
            foreach (Shared.Agregator a in ags)
            {
                agregators.Add(a);
            }

            DataGridAg.ItemsSource      = agregators;
            DataGridDevices.ItemsSource = devices;
            DataGridMerenja.ItemsSource = merenja;
            DataGridDevices.Items.Refresh();
            DataGridMerenja.Items.Refresh();
            DataGridAg.Items.Refresh();
        }
Exemplo n.º 2
0
        private void GraphBtnClick(object sender, RoutedEventArgs e)
        {
            merenja = new ObservableCollection <Merenje>();
            DataBaseOperations dbo  = new DataBaseOperations();
            List <Merenje>     ms   = new List <Merenje>();
            List <DevClass>    devs = dbo.LoadDevices();

            foreach (DevClass dc in devs)
            {
                ms = dbo.LoadMerenja();
                devices.Add(dc);
            }
            foreach (Merenje m in ms)
            {
                merenja.Add(m);
            }
        }