Esempio n. 1
0
        public IActionResult Create(string id)
        {
            var problem   = problemService.GetById(id);
            var viewModel = new ProblemSubmissionViewModel()
            {
                Name      = problem.Name,
                ProblemId = problem.Id
            };

            return(this.View(viewModel));
        }
        public IActionResult Create(string id)
        {
            Problem currentProblem = this.problemsService.ReturnCurrentProblem(id);
            ProblemSubmissionViewModel problemSubmissionViewModel = new ProblemSubmissionViewModel()
            {
                ProblemId = currentProblem.Id,
                Name      = currentProblem.Name
            };

            return(this.View(problemSubmissionViewModel));
        }
        public IActionResult Create(string id)
        {
            var problem   = this.problemsService.GetProblemById(id);
            var viewModel = new ProblemSubmissionViewModel
            {
                ProblemId = problem.Id,
                Name      = problem.Name
            };

            return(this.View(viewModel));
        }
        public HttpResponse Create(string problemId)
        {
            if (!this.IsUserLoggedIn())
            {
                return(this.Redirect("/Users/Login"));
            }

            var problemFromDb = this.problemService.GetProblemById(problemId);

            var viewModel = new ProblemSubmissionViewModel
            {
                ProblemId   = problemFromDb.Id,
                ProblemName = problemFromDb.Name
            };

            return(this.View(viewModel));
        }
        public IActionResult Create(string problemId)
        {
            var problemFromDb = this.problemService.GetProblemById(problemId);

            if (problemFromDb == null)
            {
                return(this.Redirect("/"));
            }

            var problemSubmissionViewModel = new ProblemSubmissionViewModel
            {
                ProblemId = problemId,
                Name      = problemFromDb.Name
            };

            return(this.View(problemSubmissionViewModel));
        }
Esempio n. 6
0
        public IActionResult Create(string id)
        {
            ProblemSubmissionViewModel model = problemsService.GetProblemInfo(id);

            return(View(model));
        }