public Entrenadores recuperaEntrenador(string id)
        {
            FitocracyDBDataContext fitDB      = new FitocracyDBDataContext();
            Entrenadores           entrenador = (from entren in fitDB.Entrenadores
                                                 where entren.Id_Entrenador == id
                                                 select entren).Single();

            return(entrenador);
        }
예제 #2
0
        //..............Detalle Entrenamiento.......
        public ActionResult DetalleEntrenamiento(string id, string idEntrenador)
        {
            Entrenamientos entrenamiento = dbController.recuperaEntrenamiento(id);

            ViewData["entrenamiento"] = entrenamiento;

            Entrenadores entrenador = dbController.recuperaEntrenador(idEntrenador);

            return(View(entrenador));
        }
예제 #3
0
        public ActionResult CargaCoach()
        {
            Entrenadores nuevoEntrenador = new Entrenadores();

            nuevoEntrenador.Id_Entrenador = "1007A";
            nuevoEntrenador.Nombre        = "Berzinator";
            nuevoEntrenador.Apellidos     = "Ator";
            nuevoEntrenador.Descripcion   = "Tim Berzins (Berzinator) owns and operates Berzinator Fitness Designs, a training and online coaching company based just outside of Philadelphia. With a focus on maximizing aesthetics, Tim is never satisfied with the status quo.";
            nuevoEntrenador.Foto          = ImgToDb(new FileInfo(Server.MapPath("~//Content//Imagenes//Berzinator.jpg")));

            dbController.insertaEntrenador(nuevoEntrenador);

            return(RedirectToAction("InicioCoach", "Coach"));
        }
        public void insertaEntrenador(Entrenadores nuevoEntrenador)
        {
            FitocracyDBDataContext fitDB = new FitocracyDBDataContext();

            fitDB.Entrenadores.InsertOnSubmit(nuevoEntrenador);
            try
            {
                fitDB.SubmitChanges();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
예제 #5
0
        /// <summary>
        /// Método invocado desde loginService.js
        /// Conecta con la Base de datos y comprueba el entrenador que quiere logearse
        /// </summary>
        /// <param name="entrenador"></param>
        /// <returns>El entrenador logueado</returns>
        public string loginRecupEntrenador(Entrenadores entrenador)
        {
            EncriptacionClass encriptar      = new EncriptacionClass();
            string            passEncriptada = encriptar.Encrit(entrenador.CoachPass);

            try
            {
                var entrenadorColl = _dbContext.Entrenadores.Find <Entrenadores>(x => x.CoachName == entrenador.CoachName && x.CoachPass == passEncriptada).SingleOrDefault();
                Session["infoEntrenador"] = entrenadorColl;
                return(JsonConvert.SerializeObject(entrenadorColl));
            }
            catch (Exception)
            {
                return(null);
            }
        }
예제 #6
0
        public ActionResult irAdetalleEntrenamiento(string idEntrenador, string idEntrenamiento)
        {
            Entrenadores entrenador = new Entrenadores();

            entrenador = entrenador.entrenadorById(idEntrenador);

            Entrenamientos entrenamiento = new Entrenamientos();

            entrenamiento = entrenamiento.entrenamientoById(idEntrenamiento);

            EntrenamientoEntrenadoresVM vM = new EntrenamientoEntrenadoresVM(entrenador, entrenamiento);

            TempData["vm"] = vM;

            return(Redirect("http://localhost:2841/#/detalleEntrenamiento"));
        }
예제 #7
0
        // GET: Entrenador/Create
        public ActionResult Guardar(string id_entrenador, string nombre, int edad, string pueblo, int num_medallas, string nom_medallas)
        {
            Entrenadores entrenador = new Entrenadores()
            {
                Id_Entrenador = id_entrenador,
                Nombre        = nombre,
                Edad          = edad,
                Pueblo        = pueblo,
                Num_Medallas  = num_medallas,
                Nom_Medallas  = nom_medallas,
            };

            cnx.Entrenadores.Add(entrenador);
            cnx.SaveChanges();

            return(View("Detalle_Entrenador", cnx.Entrenadores.ToList()));
        }
예제 #8
0
        public Entrenadores infoEntrenador(string id)
        {
            Entrenadores entrenador = new Entrenadores();

            return(entrenador = dbController.recuperaEntrenador(id));
        }
예제 #9
0
 public EntrenamientoEntrenadoresVM(Entrenadores entrenador, Entrenamientos entrenamiento)
 {
     this.entrenador    = entrenador;
     this.entrenamiento = entrenamiento;
 }
예제 #10
0
        public void CargaCoach()
        {
            var collection = _dbContext.GetDatabase().GetCollection <Usuario>("entrenadores");

            Entrenadores e1 = new Entrenadores();

            e1.Nombre      = "Jason";
            e1.Apellidos   = "Anyman Fitness";
            e1.Descripcion = "I am an Online Fitness Consultant from Michigan, and the founder of Anyman Fitness, LLC. I'm also a Husband, Father, Algebra Teacher, and All-American Living Room Fort Maker. I've helped thousands get lean and mean. Without cardio.";
            e1.Foto        = ImgToDb(new FileInfo(Server.MapPath("~//Content//Imagenes//Entrenadores//Jason.jpg")));

            Entrenadores e2 = new Entrenadores();

            e2.Nombre      = "Stacy";
            e2.Apellidos   = "Dishman";
            e2.Descripcion = "Hi, I'm Stacy, your Certified Personal Trainer. I have a passion for health and fitness, and helping my clients reach their goals. My workouts are fun, sweat-drenching, and never the same!";
            e2.Foto        = ImgToDb(new FileInfo(Server.MapPath("~//Content//Imagenes//Entrenadores//Stacy.jpg")));

            Entrenadores e3 = new Entrenadores();

            e3.Nombre      = "Tanner";
            e3.Apellidos   = "Baze";
            e3.Descripcion = "Whoever said fitness had to be all about douchebags can gtfo. I like to lift weights, watch romcoms, cuddle with humans and my dog Bowser. Lover of all things Star Wars and Harry Potter. If you take Superman over Batman, we aren't friends.";
            e3.Foto        = ImgToDb(new FileInfo(Server.MapPath("~//Content//Imagenes//Entrenadores//tanner.jpg")));

            Entrenadores e4 = new Entrenadores();

            e4.Nombre      = "Mike";
            e4.Apellidos   = "Yanda";
            e4.Descripcion = "I am an Attorney and nutrition/fitness consultant from the great state of Texas. I lift heavy, eat big, and work hard. My goal is show people how to make fitness work with their busy schedules.";
            e4.Foto        = ImgToDb(new FileInfo(Server.MapPath("~//Content//Imagenes//Entrenadores//mike.jpg")));

            Entrenadores e5 = new Entrenadores();

            e5.Nombre      = "Jordan";
            e5.Apellidos   = "Pagel";
            e5.Descripcion = "A NSCA Certified Personal Trainer, my passion is helping others reach their fitness goals. With 3 years of fat loss & strength training experience, my mission is to help you sculpt the body you want and become the best possible version of yourself!";
            e5.Foto        = ImgToDb(new FileInfo(Server.MapPath("~//Content//Imagenes//Entrenadores//pagel.jpg")));

            Entrenadores e6 = new Entrenadores();

            e6.Nombre      = "Allison";
            e6.Apellidos   = "Padget";
            e6.Descripcion = "Allison is a certified Personal Trainer and weight loss expert. She will help you reach a healthier and more active lifestyle. She is passionate about fitness and helping others find balance.";
            e6.Foto        = ImgToDb(new FileInfo(Server.MapPath("~//Content//Imagenes//Entrenadores//Allison.jpg")));

            Entrenadores e7 = new Entrenadores();

            e6.Nombre      = "Shelley";
            e6.Apellidos   = "Murray";
            e6.Descripcion = "I am a lifelong athlete turned strength & conditioning specialist & I help clients get stronger, faster & look better naked. I'm also a litigation attorney, a rugby junkie & an all around social butterfly known around the Fito world as Justass. :)";
            e6.Foto        = ImgToDb(new FileInfo(Server.MapPath("~//Content//Imagenes//Entrenadores//shelley.jpg")));

            Entrenadores e8 = new Entrenadores();

            e8.Nombre      = "Berzinator";
            e8.Apellidos   = "Ator";
            e8.Descripcion = "Tim Berzins (Berzinator) owns and operates Berzinator Fitness Designs, a training and online coaching company based just outside of Philadelphia. With a focus on maximizing aesthetics, Tim is never satisfied with the status quo.";
            e8.Foto        = ImgToDb(new FileInfo(Server.MapPath("~//Content//Imagenes//Entrenadores//berzinator.jpg")));

            collection.Insert(e1);
            collection.Insert(e2);
            collection.Insert(e3);
            collection.Insert(e4);
            collection.Insert(e5);
            collection.Insert(e6);
            collection.Insert(e7);
            collection.Insert(e8);
        }