// GET: Match/Delete/5 public ActionResult Delete(int id) { ServiceJediClient service = new ServiceJediClient(); MatchWCF match = service.getAllMatch().ToList().Find(x => x.Id == id); if (match == null) { return HttpNotFound(); } return View(new MatchModels(match)); }
// GET: Match/Edit/5 public ActionResult Edit(int id) { ServiceJediClient service = new ServiceJediClient(); MatchWCF match = service.getAllMatch().ToList().Find(x => x.Id == id); if (match == null) { return(HttpNotFound()); } return(View(new MatchModels(match))); }
// GET: Match public ActionResult Index() { ServiceJediClient service = new ServiceJediClient(); List <MatchModels> list = new List <MatchModels>(); foreach (MatchWCF match in service.getAllMatch()) { list.Add(new MatchModels(match)); } return(View(list)); }
public ActionResult Delete(int id, FormCollection collection) { try { ServiceJediClient service = new ServiceJediClient(); MatchWCF match = service.getAllMatch().ToList().Find(x => x.Id == id); if (match == null) { return HttpNotFound(); } service.deleteMatch(match); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Delete(int id, FormCollection collection) { try { ServiceJediClient service = new ServiceJediClient(); MatchWCF match = service.getAllMatch().ToList().Find(x => x.Id == id); if (match == null) { return(HttpNotFound()); } service.deleteMatch(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()); } }
// GET: Match public ActionResult Index() { ServiceJediClient service = new ServiceJediClient(); List<MatchModels> list = new List<MatchModels>(); foreach (MatchWCF match in service.getAllMatch()) { list.Add(new MatchModels(match)); } return View(list); }
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(); } }