Changeset 6159
- Timestamp:
- 05/07/11 14:37:12 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemController.cs
r6153 r6159 74 74 String problemDataTypeName = collection.Get("ProblemDataTypeName"); 75 75 long problemClassId = long.Parse(collection.Get("ProblemClassId")); 76 long plat tformId = long.Parse(collection.Get("PlattformId"));76 long platformId = long.Parse(collection.Get("PlatformId")); 77 77 78 78 // Later, we will get the runs from the session ... 79 79 ProblemModel pm = new ProblemModel(); 80 pm.Problem = (Problem)pm.Problems.Where(x => x.Id.Equals(problemId)).FirstOrDefault(); 80 if( problemId != 0 ) 81 pm.Problem = (Problem)pm.Problems.Where(x => x.Id.Equals(problemId)).FirstOrDefault(); 81 82 82 83 pm.Problem.Name = problemName; … … 84 85 pm.Problem.DataTypeName = problemDataTypeName; 85 86 pm.Problem.ProblemClassId = problemClassId; 86 pm.Problem.PlatformId = plat tformId;87 pm.Problem.PlatformId = platformId; 87 88 88 89 pm.SaveProblem(pm.Problem); … … 90 91 return View("Index",pm); 91 92 } 92 93 //public ActionResult CreateProblem(FormCollection collection) {94 // Problem problem = new Problem();95 // String problemName = collection.Get("ProblemName");96 // long problemClassId = long.Parse(collection.Get("ProblemClassId"));97 // long plattformId = long.Parse(collection.Get("PlattformId"));98 // problem.Name = problemName;99 // problem.ProblemClassId = problemClassId;100 // problem.PlatformId = plattformId;101 // problem.DataTypeName = "";102 // problem.DataTypeTypeName = "";103 // problem.Description = "";104 105 // // Later, we will get the runs from the session ..106 // ProblemModel pm = new ProblemModel();107 // pm.CreateProblem(problem);108 109 // return View("Index", pm);110 //}111 112 93 } 113 94 }
Note: See TracChangeset
for help on using the changeset viewer.