Esempio n. 1
0
        public async Task <IActionResult> Post(GameSimmulation oGameSimmulation)
        {
            if (ModelState.IsValid)
            {
                string sNameFileCopie = string.Empty;
                if (oGameSimmulation.MyFileUpload != null && !string.IsNullOrEmpty(oGameSimmulation.MyFileUpload.FileName))
                {
                    sNameFileCopie = await _oIFileManage_BLL.SaveFileUploadAsync(oGameSimmulation.MyFileUpload);
                }
                (bool bIsValide, string sMessageError, List <string> oListDescriptionFile) = await _oIFileManage_BLL.DataFileValideAsync(sNameFileCopie);

                if (bIsValide)
                {
                    string sNameFileResult = await _oIGameManage_BLL.RunGameAsync(oListDescriptionFile);

                    return(RedirectToAction("Details", "Home", new { @sNameFile = sNameFileResult }));
                }
                else
                {
                    ViewBag.ErrorMessage = sMessageError;
                    return(View("Index", oGameSimmulation));
                }
            }
            else
            {
                return(View("Index", oGameSimmulation));
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> Details(string sNameFile)
        {
            GameSimmulation oGameSimmulation = new GameSimmulation
            {
                FileResult = sNameFile
            };

            return(View(oGameSimmulation));
        }
Esempio n. 3
0
        public async Task <IActionResult> Index()
        {
            GameSimmulation oGameSimmulation = new GameSimmulation();

            return(View(oGameSimmulation));
        }