コード例 #1
0
 // 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));
 }
コード例 #2
0
        // 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)));
        }
コード例 #3
0
        // 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));
        }
コード例 #4
0
        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();
            }
        }
コード例 #5
0
        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());
            }
        }
コード例 #6
0
        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());
            }
        }
コード例 #7
0
        // 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);
        }
コード例 #8
0
        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();
            }
        }