예제 #1
0
        public ActionResult AjoutJoueurPoule(int?joueur, int pos, int matchg, int matchp)
        {
            infoJoueur j = new infoJoueur {
                position = pos, matchGagné = matchg, matchPerdu = matchp, Id = Convert.ToInt32(joueur)
            };
            DCJoueur dc = new DCJoueur();

            dc.InsertLD(j, (int)Session["idPoule"]);
            Session["idPoule"] = null;
            return(Redirect("~/Competition/InfoComp/" + Session["idC"]));
        }
예제 #2
0
        public List <Poule> GetListPoule(int idComp)
        {
            DCPoule    dc = new DCPoule();
            infoJoueur m  = new infoJoueur();

            List <Poule> listP = dc.findAll(idComp);

            foreach (Poule p in listP)
            {
                p.LJoueur = m.GetListJoueur(p.Id);
            }
            return(listP);
        }
예제 #3
0
        public ActionResult ModifierJoueurPoule(int id, int idP, int idJ, int matchG, int matchP, int pos)
        {
            infoJoueur j = new infoJoueur
            {
                matchGagné = matchG,
                matchPerdu = matchP,
                position   = pos,
                Id         = idJ
            };

            Session["idC"] = id;
            ViewBag.idP    = idP;
            return(View(j));
        }
예제 #4
0
        public ActionResult ModifierJpoule(int idP, int idJ, int pos, int matchG, int matchP)
        {
            infoJoueur j = new infoJoueur
            {
                matchGagné = matchG,
                matchPerdu = matchP,
                position   = pos,
                Id         = Convert.ToInt32(idJ)
            };

            DCJoueur dc = new DCJoueur();

            dc.UpdateLD(j, idP);
            return(Redirect("~/Competition/InfoComp/" + Session["idC"]));
        }
예제 #5
0
        public bool UpdateLD(infoJoueur j, int idPoule)
        {
            DBConnection con = DBConnection.Instance();

            if (con.IsConnect())
            {
                //récupérer les joueurs grâce à leur sex
                string query  = "UPDATE `ld_joueur_serie` SET `position` = '" + j.position + "', `matchGagne` = '" + j.matchGagné + "', `matchPerdu` = '" + j.matchPerdu + "' WHERE `ld_joueur_serie`.`idJoueur` = " + j.Id + " AND `ld_joueur_serie`.`idSerie` = " + idPoule;
                var    cmd    = new MySqlCommand(query, con.Connection);
                var    reader = cmd.ExecuteReader();

                reader.Close();
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #6
0
        public bool InsertLD(infoJoueur j, int idPoule)
        {
            DBConnection con = DBConnection.Instance();

            if (con.IsConnect())
            {
                //récupérer les joueurs grâce à leur sex
                string query  = "INSERT INTO `ld_joueur_serie` (`idJoueur`, `idSerie`, `position`, `matchGagne`, `matchPerdu`) VALUES ('" + j.Id + "', '" + idPoule + "', '" + j.position + "', '" + j.matchGagné + "', '" + j.matchPerdu + "')";
                var    cmd    = new MySqlCommand(query, con.Connection);
                var    reader = cmd.ExecuteReader();

                reader.Close();
                return(true);
            }
            else
            {
                return(false);
            }
        }