public DeviceSimulateViewModel()
        {
            _dataService = new DataService();
            _deviceSimu = new DevicesSimulationView();
            _devices = new ObservableCollection<DeviceSimulateView>();

            GetDevicesSimulation();
        }
Esempio n. 2
0
        public List<DevicesSimulationView> GetData()
        {
            string[] imeis = { "MCN-James", "MCN-John", "MCN-Danny", "MCN-Michelle", "MCN-Tina", "MCN-Rachel", "MCN-Todd", "MCN-Elaine", "MCN-Tonya", "MCN-Derek", "MCN-Mike" };
            string[] descs = { "Doe", "Thomas", "Smith", "Wahlin", "Taft", "Adams", "Schiller", "Carpenter", "Peterson", "Wilson", "Warner" };
            List<DevicesSimulationView> devices = new List<DevicesSimulationView>();

            Random r2 = new Random();
            Random r = new Random();
            for (int i = 0; i < 10; i++)
            {
                int index = r.Next(0, 11);
                DevicesSimulationView p = new DevicesSimulationView
                {
                    Imei = imeis[index],
                    Description = descs[index],
                    SendTotal = r2.Next(10, 90)
                };
                devices.Add(p);
            }
            return devices;
        }