예제 #1
0
        public ActionResult Rejudge(FormCollection form)
        {
            String sids      = form["sids"];
            String cid       = form["cid"];
            String pid       = form["pid"];
            String name      = form["username"];
            String lang      = form["lang"];
            String type      = form["type"];
            String startDate = (String.IsNullOrEmpty(form["startdate"]) ? String.Empty : String.Format("{0} {1}:{2}:{3}", form["startdate"], form["starthour"], form["startminute"], form["startsecond"]));
            String endDate   = (String.IsNullOrEmpty(form["enddate"]) ? String.Empty : String.Format("{0} {1}:{2}:{3}", form["enddate"], form["endhour"], form["endminute"], form["endsecond"]));

            return(ResultToMessagePage(() =>
            {
                IMethodResult result = SolutionManager.AdminRejudgeSolution(sids, cid, pid, name, lang, type, startDate, endDate);

                if (!result.IsSuccess)
                {
                    return new Tuple <IMethodResult, String>(result, String.Empty);
                }

                String successInfo = String.Format("{0} solution(s) have been successfully rejudged!", result.ResultObject.ToString());

                return new Tuple <IMethodResult, String>(result, successInfo);
            }));
        }