Пример #1
0
        private static void SeedReto()
        {
            LogEjercicio le = new LogEjercicio();


            Reto r = new Reto();

            r.Owner       = "zeitgeist";
            r.Entrenador  = "catalinadelacuesta";
            r.FechaInicio = new DateTime(2014, 8, 18);
            r.FechaFin    = new DateTime(2014, 8, 22);
            r.Deportes.Add("53f54215f623e87a24777ec2");
            r.Tipo     = TipoReto.PrimeroEnLlegar;
            r.Division = "53f54144f623e879c4e0cd85";
            r.Meta     = 100000;
            r.IsActivo = true;
            r.Premio   = "Panceroti para el desayuno del lunes";
            r.Equipos.Add("53f54144f623e879c4e0cd83");
            r.Equipos.Add("53f54144f623e879c4e0cd84");

            Database.GetCollection("reto").Save(r);
            Reto r2 = new Reto();

            r2.Owner       = "zeitgeist";
            r2.Entrenador  = "catalinadelacuesta";
            r2.FechaInicio = new DateTime(2014, 8, 25);
            r2.FechaFin    = new DateTime(2014, 8, 29);
            r2.Deportes.Add("53f54215f623e87a24777ec2");
            r2.Tipo     = TipoReto.Superando;
            r2.Division = "53f54145f623e879c4e0cd8a";
            r2.IsActivo = false;
            r2.Premio   = "El dia viernes el ganador sale 30 minutos más temprano.";
            r2.Equipos.Add("53f54145f623e879c4e0cd88");
            r2.Equipos.Add("53f54145f623e879c4e0cd89");
            Database.GetCollection("reto").Save(r2);


            Reto r3 = new Reto();

            r3.Owner       = "catalinadelacuesta";
            r3.Entrenador  = "catalinadelacuesta";
            r3.FechaInicio = new DateTime(2014, 8, 18);
            r3.FechaFin    = new DateTime(2014, 8, 29);
            r3.Deportes.Add("53f54215f623e87a24777ec2");
            r3.Tipo     = TipoReto.Constancia;
            r3.Division = "53f54140f623e879c4e0cd72";
            r3.IsActivo = true;
            r.Meta      = 6000;
            r3.Premio   = "Botella de Boons.";
            r3.Equipos.Add("53f5413ef623e879c4e0cd70");
            r3.Equipos.Add("53f54140f623e879c4e0cd71");
            Database.GetCollection("reto").Save(r3);
        }
Пример #2
0
        public ResponseLogEjercicio Any(RequestLogEjercicio reg)
        {
            //Manager m = Manager.Instance;
            LogEjercicio l = new LogEjercicio();

            l.User      = _userService.GetCustomerByUsername(reg.Usuario);
            l.Velocidad = 32;
            l.Ubicacion = "";
            l.Fecha     = reg.FechaHora;
            l.Conteo    = reg.Conteo;
            l.DeporteId = reg.Deporte;

            _logsRepository.Insert(l);

            ResponseLogEjercicio res = new ResponseLogEjercicio();

            res.State   = true;
            res.Message = "Se ha guardado con exito el registro.";
            return(res);
        }
Пример #3
0
        private static void Seed()
        {
            Dictionary <string, Queue <PasoVel> > dic = new Dictionary <string, Queue <PasoVel> >();

            List <PasoVel> paso = new List <PasoVel>()
            {
                new PasoVel(6110, 3900), new PasoVel(4207, 4500), new PasoVel(3706, 1600), new PasoVel(7159, 6150), new PasoVel(3776, 1280)
            };
            List <PasoVel> paso2 = new List <PasoVel>()
            {
                new PasoVel(6598, 7440), new PasoVel(5269, 8796), new PasoVel(4328, 2869), new PasoVel(7153, 10598), new PasoVel(4121, 5986)
            };
            List <PasoVel> paso3 = new List <PasoVel>()
            {
                new PasoVel(4258, 1596), new PasoVel(3865, 2486), new PasoVel(5698, 6257), new PasoVel(4593, 5374), new PasoVel(3886, 2047)
            };
            List <PasoVel> paso4 = new List <PasoVel>()
            {
                new PasoVel(3658, 3526), new PasoVel(4067, 4659), new PasoVel(3749, 2759), new PasoVel(3896, 3627), new PasoVel(3869, 4685)
            };
            List <PasoVel> paso5 = new List <PasoVel>()
            {
                new PasoVel(4956, 5326), new PasoVel(4025, 2658), new PasoVel(5036, 7598), new PasoVel(5238, 6589), new PasoVel(5987, 7259)
            };
            List <PasoVel> paso6 = new List <PasoVel>()
            {
                new PasoVel(5025, 2158), new PasoVel(4856, 1329), new PasoVel(5039, 2698), new PasoVel(6032, 6249), new PasoVel(6124, 7526)
            };
            List <PasoVel> paso7 = new List <PasoVel>()
            {
                new PasoVel(4569, 4368), new PasoVel(5003, 5032), new PasoVel(4695, 4268), new PasoVel(5628, 7956), new PasoVel(5133, 4025)
            };
            List <PasoVel> paso8 = new List <PasoVel>()
            {
                new PasoVel(5248, 5369), new PasoVel(5628, 7589), new PasoVel(6035, 9148), new PasoVel(6258, 11328), new PasoVel(4865, 3596)
            };

            dic.Add("ddo88", new Queue <PasoVel>(paso));
            dic.Add("catalinadelacuesta", new Queue <PasoVel>(paso2));
            dic.Add("sthejoker", new Queue <PasoVel>(paso3));
            dic.Add("mmunera", new Queue <PasoVel>(paso4));
            dic.Add("jvanegas", new Queue <PasoVel>(paso5));
            dic.Add("mdelacue", new Queue <PasoVel>(paso6));
            dic.Add("laurablandon", new Queue <PasoVel>(paso7));
            dic.Add("restrepo.cafe", new Queue <PasoVel>(paso8));

            foreach (var usuario in dic)
            {
                for (int i = 0; i < 5; i++)
                {
                    LogEjercicio le = new LogEjercicio();
                    le.Usuario   = usuario.Key;
                    le.FechaHora = DateTime.Now.AddDays(-i);
                    le.Deporte   = "Caminar";
                    le.Ubicacion = "lat=, lon=";
                    PasoVel pv = usuario.Value.Dequeue();
                    le.Conteo    = pv.Conteo;
                    le.Velocidad = pv.Velocidad;
                    Database.GetCollection <LogEjercicio>("LogEjercicio").Save(le);
                }
            }
        }