public ActionResult ModifierComp(int id, string nom, DateTime dateD, DateTime dateF, string type, string nbrJ, int idc) { SousCategorie sc = new SousCategorie(); List <SousCategorie> lSC = new List <SousCategorie>(); lSC = sc.GetList(idc); List <CPays> listePays = new CPays().GetListPays(); listePays.Insert(0, (CPays)Session["CPays"]); List <String> listeType = new List <String>(); listeType.Add(type); listeType.Add("Masculin"); listeType.Add("Féminin"); listeType.Add("Mixte"); List <String> listeNbrJ = new List <String>(); listeNbrJ.Add(nbrJ); listeNbrJ.Add("Individuel"); listeNbrJ.Add("Equipe"); ViewBag.listeSC = new SelectList(lSC, "Id", "Nom"); ViewBag.listePays = new SelectList(listePays, "Id", "Pays"); ViewBag.listeType = new SelectList(listeType); ViewBag.listeNbrJ = new SelectList(listeNbrJ); ViewBag.Nom = nom; ViewBag.dateD = dateD; ViewBag.dateF = dateF; ViewBag.idComp = id; return(View()); }
public ActionResult UpdateFederation(int id) { Federation federation = new Federation(); List <CPays> listP = new CPays().GetListPays(); CPays pays = null; federation = federation.GetFederation(id); foreach (CPays P in listP) { if (P.Pays == federation.PaysFederation) { pays = P; } } listP.Insert(0, pays); Session["listP"] = new SelectList(listP, "Id", "Pays"); return(View(federation)); }