コード例 #1
0
        //Lấy tất cả CLB tham gia tại mùa giải đó
        public void SetListClub(string selected_id_homeClub = null, string selected_id_guestClub = null, string season_id = null)
        {
            var dao = new football_club_dao();

            ViewData["HomeClub"]  = new SelectList(dao.ListClub_BySeason(season_id), "id", "name", selected_id_homeClub);
            ViewData["GuestClub"] = new SelectList(dao.ListClub_BySeason(season_id), "id", "name", selected_id_guestClub);
        }
コード例 #2
0
        public ActionResult Index(int page = 1, int page_size = 15)
        {
            var dao   = new football_club_dao();
            var model = dao.ListAllPaging(page, page_size);

            SetListSeason();
            return(View(model));
        }
コード例 #3
0
        public JsonResult ChangeActive(string id)
        {
            var result = new football_club_dao().ChangeActive(id);

            return(Json(new
            {
                status = result
            }));
        }
コード例 #4
0
        public ActionResult Index(int page = 1, int page_size = 15, string season_id = null)
        {
            var dao   = new season_dao();
            var model = new football_club_dao().ListClub_BySeason(ref season_id, page, page_size);

            SetListSeason(season_id);
            ViewBag.currentSeasonID = season_id;

            return(View(model));
        }
コード例 #5
0
 public ActionResult DeleteAllChecked(string ids)
 {
     if (ids != "" && ids != null)
     {
         string[] array_id = ids.Split(',');
         var      dao      = new football_club_dao();
         foreach (var id in array_id)
         {
             dao.Delete(id);
         }
     }
     return(RedirectToAction("Index"));
 }
コード例 #6
0
        public ActionResult Index(int page = 1, int page_size = 15, string club_id = "", string season_id = null)
        {
            var dao   = new footballer_dao();
            var model = dao.ListAllPaging(ref season_id, page, page_size, club_id);

            var club = new football_club_dao().Get_By_Id(club_id);

            if (club != null)
            {
                ViewBag.FootballClub_Name = club.name;
                ViewBag.FootballClub_ID   = club.id;
            }

            ViewBag.CurrentSeason = season_id;
            SetListSeason();
            return(View(model));
        }
コード例 #7
0
        public ActionResult Edit(football_club pos)
        {
            if (ModelState.IsValid)
            {
                var dao = new football_club_dao();

                var result = dao.Update(pos);
                if (result)
                {
                    SetAlert(StaticResources.Resources.Pub_UpdateSucess, "success");
                    return(RedirectToAction("Index", "FootballClub"));
                }
                else
                {
                    ModelState.AddModelError("", StaticResources.Resources.UpdateFootballClubFailed);
                }
            }
            return(View());
        }
コード例 #8
0
        public ActionResult Create(football_club club)
        {
            if (ModelState.IsValid)
            {
                var dao = new football_club_dao();

                bool result = dao.Insert(club);
                if (result)
                {
                    SetAlert(StaticResources.Resources.Pub_InsertSuccess, "success");
                    return(RedirectToAction("Index", "FootballClub"));
                }
                else
                {
                    ModelState.AddModelError("", StaticResources.Resources.InsertFootballClubFailed);
                }
            }
            return(View());
        }
コード例 #9
0
        public void SetListClub(string selected_id = null)
        {
            var dao = new football_club_dao();

            ViewData["Club"] = new SelectList(dao.ListAll(), "id", "name", selected_id);
        }
コード例 #10
0
        public ActionResult Edit(string id)
        {
            var model = new football_club_dao().Get_By_Id(id);

            return(View(model));
        }