public ActionResult End(int idJedi, int bank, bool win) { ServiceJediClient service = new ServiceJediClient(); TournoiEnd tournoiEnd = new TournoiEnd(); string str; if (win) { str = "Vous avez bien parie sur ce dernier match ! Felicitation ! "; } else { str = "Vous avez mal parie sur ce dernier match "; } JediModels jedi = new JediModels(service.getAllJedi().ToList().Find(x => x.Id == idJedi)); tournoiEnd.Bank = bank; tournoiEnd.JediGagnant = jedi.Nom; tournoiEnd.MessageEnd = str; return(View(tournoiEnd)); }
public ActionResult Edit(int id, FormCollection collection) { try { ServiceJediClient service = new ServiceJediClient(); List <CaracteristiqueWCF> listCar = service.getAllCaracteristique().ToList(); JediWCF jediWCF = service.getAllJedi().ToList().Find(x => x.Id == id); jediWCF.Nom = collection[2]; jediWCF.IsSith = collection[3].StartsWith("true"); List <CaracteristiqueWCF> listCarRes = new List <CaracteristiqueWCF>(); char[] delimiterChars = { ',' }; string[] caractStr = collection[4].Split(delimiterChars); foreach (string str in caractStr) { if (str != "false") { listCarRes.Add(listCar.Find(x => x.Id == Int32.Parse(str))); } } jediWCF.Caracteristiques = listCarRes.ToArray(); service.updateJedi(jediWCF); return(RedirectToAction("Index")); } catch { return(View()); } }
// // GET: /Jedi/Delete/5 public ActionResult Delete(int id) { ServiceJediClient service = new ServiceJediClient(); JediWCF jedi = service.getAllJedi().ToList().Find(x => x.Id == id); if (jedi == null) { return HttpNotFound(); } return View(new JediModels(jedi)); }
// // GET: /Jedi/Edit/5 public ActionResult Edit(int id) { ServiceJediClient service = new ServiceJediClient(); JediWCF jedi = service.getAllJedi().ToList().Find(x => x.Id == id); if (jedi == null) { return(HttpNotFound()); } return(View(new JediModels(jedi))); }
public ActionResult ListJedi() { ServiceJediClient service = new ServiceJediClient(); List <JediModels> list = new List <JediModels>(); foreach (JediWCF j in service.getAllJedi()) { list.Add(new JediModels(j)); } return(PartialView(list)); }
// // GET: /Jedi/ public ActionResult Index() { ServiceJediClient service = new ServiceJediClient(); List <JediModels> list = new List <JediModels>(); foreach (JediWCF jedi in service.getAllJedi()) { list.Add(new JediModels(jedi)); } return(View(list)); }
public ActionResult Delete(int id, FormCollection collection) { try { ServiceJediClient service = new ServiceJediClient(); JediWCF jedi = service.getAllJedi().ToList().Find(x => x.Id == id); if (jedi == null) { return HttpNotFound(); } service.deleteJedi(jedi); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Delete(int id, FormCollection collection) { try { ServiceJediClient service = new ServiceJediClient(); JediWCF jedi = service.getAllJedi().ToList().Find(x => x.Id == id); if (jedi == null) { return(HttpNotFound()); } service.deleteJedi(jedi); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, FormCollection collection) { try { ServiceJediClient service = new ServiceJediClient(); List <JediWCF> listJedis = service.getAllJedi().ToList(); List <StadeWCF> listStades = service.getAllStade().ToList(); MatchWCF match = service.getAllMatch().ToList().Find(x => x.Id == id); match.Jedi1 = listJedis.Find(x => x.Id == Int32.Parse(collection[2])); match.Jedi2 = listJedis.Find(x => x.Id == Int32.Parse(collection[3])); match.PhaseTournoi = (EPhaseTournoi)Enum.Parse(typeof(EPhaseTournoi), collection[4], true); match.Stade = listStades.Find(x => x.Id == Int32.Parse(collection[5])); service.updateMatch(match); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(FormCollection collection) { try { string str1 = collection[0]; string str2 = collection[1]; ServiceJediClient service = new ServiceJediClient(); List<JediWCF> listJedis = service.getAllJedi().ToList(); List<StadeWCF> listStades = service.getAllStade().ToList(); MatchWCF match = new MatchWCF(); match.Jedi1 = listJedis.Find(x => x.Id == Int32.Parse(collection[1])); match.Jedi2 = listJedis.Find(x => x .Id == Int32.Parse(collection[2])); match.PhaseTournoi = (EPhaseTournoi)Enum.Parse(typeof(EPhaseTournoi), collection[3], true); match.Stade = listStades.Find(x => x.Id == Int32.Parse(collection[4])); service.addMatch(match); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Create(FormCollection collection) { try { string str1 = collection[0]; string str2 = collection[1]; ServiceJediClient service = new ServiceJediClient(); List <JediWCF> listJedis = service.getAllJedi().ToList(); List <StadeWCF> listStades = service.getAllStade().ToList(); MatchWCF match = new MatchWCF(); match.Jedi1 = listJedis.Find(x => x.Id == Int32.Parse(collection[1])); match.Jedi2 = listJedis.Find(x => x.Id == Int32.Parse(collection[2])); match.PhaseTournoi = (EPhaseTournoi)Enum.Parse(typeof(EPhaseTournoi), collection[3], true); match.Stade = listStades.Find(x => x.Id == Int32.Parse(collection[4])); service.addMatch(match); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, FormCollection collection) { try { ServiceJediClient service = new ServiceJediClient(); List<JediWCF> listJedis = service.getAllJedi().ToList(); List<StadeWCF> listStades = service.getAllStade().ToList(); MatchWCF match = service.getAllMatch().ToList().Find(x => x.Id == id); match.Jedi1 = listJedis.Find(x => x.Id == Int32.Parse(collection[2])); match.Jedi2 = listJedis.Find(x => x.Id == Int32.Parse(collection[3])); match.PhaseTournoi = (EPhaseTournoi)Enum.Parse(typeof(EPhaseTournoi), collection[4], true); match.Stade = listStades.Find(x => x.Id == Int32.Parse(collection[5])); service.updateMatch(match); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult End(int idJedi, int bank, bool win) { ServiceJediClient service = new ServiceJediClient(); TournoiEnd tournoiEnd = new TournoiEnd(); string str; if (win) { str = "Vous avez bien parie sur ce dernier match ! Felicitation ! "; } else { str = "Vous avez mal parie sur ce dernier match "; } JediModels jedi = new JediModels(service.getAllJedi().ToList().Find(x => x.Id == idJedi)); tournoiEnd.Bank = bank; tournoiEnd.JediGagnant = jedi.Nom; tournoiEnd.MessageEnd = str; return View(tournoiEnd); }
public ActionResult ListJedi() { ServiceJediClient service = new ServiceJediClient(); List<JediModels> list = new List<JediModels>(); foreach (JediWCF j in service.getAllJedi()) { list.Add(new JediModels(j)); } return PartialView(list); }
// // GET: /Jedi/ public ActionResult Index() { ServiceJediClient service = new ServiceJediClient(); List<JediModels> list = new List<JediModels>(); foreach (JediWCF jedi in service.getAllJedi()) { list.Add(new JediModels(jedi)); } return View(list); }
public ActionResult Edit(int id, FormCollection collection) { try { ServiceJediClient service = new ServiceJediClient(); List<CaracteristiqueWCF> listCar = service.getAllCaracteristique().ToList(); JediWCF jediWCF = service.getAllJedi().ToList().Find(x => x.Id == id); jediWCF.Nom = collection[2]; jediWCF.IsSith = collection[3].StartsWith("true"); List<CaracteristiqueWCF> listCarRes = new List<CaracteristiqueWCF>(); char[] delimiterChars = { ',' }; string[] caractStr = collection[4].Split(delimiterChars); foreach (string str in caractStr) { if (str != "false") { listCarRes.Add(listCar.Find(x => x.Id == Int32.Parse(str))); } } jediWCF.Caracteristiques = listCarRes.ToArray(); service.updateJedi(jediWCF); return RedirectToAction("Index"); } catch { return View(); } }