示例#1
0
        public ActionResult New(int id)
        {
            var langs = session.CreateCriteria <Language>().List <Language>();

            return(View(new NewSolutionForm
            {
                Languages = Choose.Create(langs, l => l.Name, l => l.Name),
                ProblemId = id
            }));
        }
示例#2
0
        public ActionResult Edit(int id)
        {
            var problem = session.Get <Problem>(id);
            var langs   = session.CreateCriteria <Language>().List <Language>();
            var checker = problem.TestInfo.Checker;

            return(View(new EditProblemForm
            {
                ProblemId = problem.Id,
                CheckerArguments = problem.TestInfo.CheckerArguments,
                CheckerSource = checker.Code,
                CheckerLanguages = Choose.Create(langs, l => l.Name, l => l.Name, checker.LanguageId),
                DocumentFormatters =
                    Choose.Create(formatters.GetAll(), f => f.Name, f => f.Name, problem.Statement.BodyFormatterId),
                Limits = problem.Limits,
                ShortName = problem.ShortName,
                Name = problem.Statement.Name,
                ProblemBody = problem.Statement.Body,
                Tests = problem.TestInfo.Tests
            }));
        }
        public ActionResult MassNew()
        {
            var contests = session.CreateCriteria <Contest>().List <Contest>();

            return(View(Choose.Create(contests, x => x.Announcement.Name, x => x.Id)));
        }