Ejemplo n.º 1
0
        public IActionResult Index()
        {
            OSTypeViewModel osTypeViewModel = new OSTypeViewModel();

            osTypeViewModel.OSTypeList     = _osTypeList;
            osTypeViewModel.SelectedOSType = String.Empty;

            // ViewBag.connectionstring = _configuration["RootPath"];
            // if (TempData["ErrorOsSelectionMessage"] != null)
            //     ViewBag.ErrorOsSelection = TempData["ErrorOsSelectionMessage"].ToString();
            return(View(osTypeViewModel));
        }
Ejemplo n.º 2
0
        public IActionResult Index(OSTypeViewModel OsTypeViewModel)
        {
            if (OsTypeViewModel.SelectedOSType != null)
            {
                // I'm strongly confident to use Parse instead of TryParse
                _selectedOsIndex = Int32.Parse(OsTypeViewModel.SelectedOSType);

                // Int32.TryParse(
                //     OsTypeViewModel.SelectedOSType,
                //     out iSelectOs);

                // return RedirectToAction(
                //     "UploadSources",
                //     new { SelectedOsIndex = _selectedOsIndex });

                return(RedirectToAction(
                           "UploadSources"));
            }
            else
            {
                // TempData["ErrorOsSelectionMessage"] = "Please select one of the above options!";
                return(RedirectToAction("Index", "Execute"));
            }
        }