コード例 #1
0
        public IActionResult DeleteMecz(MeczListOpak retmecz) //delete()
        {
            if (!db.deleteMecz(retmecz.IdMecz))
            {
                ViewBag.Error = "SQL Exception";
                return(View(retmecz));
            }

            return(RedirectToAction("Komunikat", new { msg = "delete" }));
        }
コード例 #2
0
        public IActionResult DeleteMecz(int?id)
        {
            List <MeczListOpak> data    = db.getMeczList();
            MeczListOpak        retmecz = null;

            foreach (MeczListOpak m in data)
            {
                if (m.IdMecz == id)
                {
                    retmecz = m;
                }
            }

            return(View(retmecz));
        }
コード例 #3
0
        public IActionResult Details(int id)
        {
            List <MeczListOpak> lis = db.getMeczList();

            MeczListOpak mecz = new MeczListOpak();

            foreach (MeczListOpak m in lis)
            {
                if (m.IdMecz == id)
                {
                    mecz = m;
                }
            }

            MeczDetails details = new MeczDetails
            {
                Kibice = db.getKibicList(id),
                Sedzia = db.getSedziaByMecz(id)
            };


            if (details.Kibice.Count == 0)
            {
                details.Kibice.Add(new Zawodnik {
                    Imie = "null", Nazwisko = "null"
                });
            }

            if (details.Sedzia.Imie == null)
            {
                details.Sedzia.Imie = "null";
            }


            ViewBag.Gosci = details;

            return(View(mecz));
        } //details list()