Пример #1
0
 public ActionResult AddLeague(int?index)
 {
     if (index == null)
     {
         LeagueX model = new LeagueX();
         return(View(model));
     }
     else
     {
         var model = LeagueService.GetLeagueByID(index.Value);
         return(View(model));
     }
 }
Пример #2
0
        public ActionResult AddLeague(LeagueX leage, HttpPostedFileBase[] fileExcel)
        {
            //Ensure model state is valid
            var adminInfo = (LoginModel)Session["AdminInfo"];

            if (adminInfo == null)
            {
                return(RedirectToAction("Login", "Account", new { area = "" }));
            }
            if (ModelState.IsValid)
            {   //iterating through multiple file collection
                foreach (HttpPostedFileBase file in fileExcel)
                {
                    //Checking file is available to save.
                    if (file != null && file.ContentLength > 0)
                    {
                        //Xu ly
                        // thong tin team , footballer ,
                    }
                }
            }
            return(RedirectToAction("DetailLeague", "Common", new { id = 1, area = "" })); //SCOPE_IDENTITY()
        }