示例#1
0
        public void AjouterAuPoule(infoJoueur j, int idPoule)
        {
            List <infoJoueur> lJoueur = new infoJoueur().GetListJoueur(idPoule);
            int cpt = 1;

            foreach (infoJoueur joueur in lJoueur)
            {
                if (j.matchGagné - j.matchPerdu > joueur.matchGagné - joueur.matchPerdu)
                {
                    joueur.position++;
                }
                else
                {
                    cpt++;
                }
            }
            j.position = cpt;
            DCJoueur dc = new DCJoueur();

            foreach (infoJoueur joueur in lJoueur)
            {
                dc.UpdateLD(joueur, idPoule);
            }
            dc.InsertLD(j, idPoule);
        }
示例#2
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"]));
        }