Exemple #1
0
        public static VideoLog[] GetSeederData()
        {
            var    droneSeeder = new List <VideoLog>();
            var    rand        = new Random();
            string projectType = Models.ProjectType.GetRandomProjectType();

            for (var i = 0; i < 40; i++)
            {
                var ranDay    = rand.Next(1, 3);
                var ranHour   = rand.Next(1, 18);
                var ranMinute = rand.Next(1, 50);
                var apiType   = Utility.GetRandomApiType();
                var droneLog  = new VideoLog()
                {
                    EntityLogPrimaryKeyId = i + 10,
                    DroneId     = DroneLog.GetRandomEntityId(),
                    AuthorId    = UserLog.GetRandomEntityId(),
                    EntityId    = VideoLog.GetRandomEntityId(),
                    IncidentId  = IncidentLog.GetRandomEntityId(),
                    Type        = apiType,
                    ProjectType = projectType,
                    Description = "Video theo dõi " + projectType + " " + Utility.RandomString(5),
                    Link        = "Video " + Utility.RandomString(2),
                    Timestamp   = new DateTime(2020, 12, ranDay, ranHour, ranMinute, 0),
                    State       = i % 2 + ""
                };
                droneSeeder.Add(droneLog);
            }

            return(droneSeeder.ToArray());
        }
Exemple #2
0
        public static IncidentLog[] GetSeederData()
        {
            var droneSeeder = new List <IncidentLog>();
            var rand        = new Random();

            for (var i = 0; i < 40; i++)
            {
                int    ranDay      = rand.Next(1, 3);
                int    ranHour     = rand.Next(1, 18);
                int    ranMinute   = rand.Next(1, 50);
                var    apiType     = Utility.GetRandomApiType();
                string projectType = Models.ProjectType.GetRandomProjectType();
                var    droneLog    = new IncidentLog()
                {
                    EntityLogPrimaryKeyId = i + 10,
                    EntityId    = IncidentLog.GetRandomEntityId(),
                    AuthorId    = UserLog.GetRandomEntityId(),
                    RegionId    = MonitorRegionLog.GetRandomEntityId(),
                    ProjectType = projectType,
                    Type        = apiType,
                    Description = "Incident " + apiType.GetDescription(),
                    Name        = "Incident " + Utility.RandomString(2),
                    Timestamp   = new DateTime(2020, 12, ranDay, ranHour, ranMinute, 0),
                    State       = i % 2 + ""
                };
                droneSeeder.Add(droneLog);
            }

            return(droneSeeder.ToArray());
        }