- Timestamp:
- 05/07/11 15:35:44 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemController.cs ¶
r6159 r6162 25 25 } 26 26 27 /// <summary> 28 /// Controller for Index View 29 /// </summary> 30 /// <returns></returns> 27 31 public ActionResult SortAsc() { 28 32 Session["SelectedSubMenu"] = "Problem"; 29 33 ProblemModel pm = new ProblemModel(); 30 pm.Problems .OrderBy(x => x.Name);34 pm.Problems = pm.Problems.OrderBy(x => x.Name).ToList<Problem>(); 31 35 return View("Index",pm); 32 36 } 33 37 38 /// <summary> 39 /// Controller for Index View 40 /// </summary> 41 /// <returns></returns> 34 42 public ActionResult SortDesc() { 35 43 Session["SelectedSubMenu"] = "Problem"; 36 44 ProblemModel pm = new ProblemModel(); 37 pm.Problems .OrderByDescending(x => x.Name);45 pm.Problems = pm.Problems.OrderByDescending(x => x.Name).ToArray<Problem>(); 38 46 return View("Index",pm); 39 47 } … … 56 64 } 57 65 66 /// <summary> 67 /// Controller for Index View 68 /// </summary> 69 /// <returns></returns> 58 70 public ActionResult Delete(long id) { 59 71 Session["SelectedSubMenu"] = "Problem"; … … 62 74 ProblemModel pm = new ProblemModel(); 63 75 if(id != 0) { 64 pm.Problem = (Problem)pm.Problems.Where(x => x.Id.Equals(id)).FirstOrDefault(); 65 // pm.DeleteProblem(); 76 pm.DeleteProblem(id); 66 77 } 67 return View( pm);78 return View("Index", pm); 68 79 } 69 80 81 /// <summary> 82 /// Controller for Detail View 83 /// </summary> 84 /// <returns></returns> 70 85 public ActionResult SaveChanges(FormCollection collection) { 71 86 long problemId = long.Parse(collection.Get("ProblemId")); … … 78 93 // Later, we will get the runs from the session ... 79 94 ProblemModel pm = new ProblemModel(); 80 if( problemId != 0)95 if(problemId != 0) 81 96 pm.Problem = (Problem)pm.Problems.Where(x => x.Id.Equals(problemId)).FirstOrDefault(); 82 97 … … 84 99 pm.Problem.Description = problemDescription; 85 100 pm.Problem.DataTypeName = problemDataTypeName; 101 pm.Problem.DataTypeTypeName = ""; 86 102 pm.Problem.ProblemClassId = problemClassId; 87 103 pm.Problem.PlatformId = platformId;
Note: See TracChangeset
for help on using the changeset viewer.