Changeset 6162 for branches/WebApplication/MVC2
- Timestamp:
- 05/07/11 15:35:44 (14 years ago)
- Location:
- branches/WebApplication/MVC2/HLWebOKBAdminPlugin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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; -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Admin/AlgorithmClass.aspx
r6050 r6162 1 1 <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 2 3 <asp:Content ID="Content3" runat="server" ContentPlaceHolderID="SubMenuContent">4 <% Html.RenderAction("Menu"); %>5 </asp:Content>6 3 7 4 <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> 8 5 AlgorithmClass 9 6 </asp:Content> 7 <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 8 <form id="formAlgorithmClass" runat="server"> 9 <h2> 10 AlgorithmClass</h2> 11 <asp:ListBox ID="lbxAlgorithmClasses" runat="server" DataTextField="Name" DataValueField="Id" 12 Height="350px" Style="margin-top: 0px" Width="240px" DataSourceID="odsAlgorithmClasses"> 13 </asp:ListBox> 14 <asp:ObjectDataSource ID="odsAlgorithmClasses" runat="server" SelectMethod="AlgorithmClassGetAll" 15 TypeName="HLWebOKBAdminPlugin.Models.AdminModel"></asp:ObjectDataSource> 10 16 11 <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 12 13 <form id="formAlgorithmClass" runat="server"> 14 15 <h2>AlgorithmClass</h2> 16 17 <asp:ListBox ID="lbxAlgorithmClasses" runat="server" 18 DataTextField="Name" DataValueField="Id" Height="350px" style="margin-top: 0px" 19 Width="240px" DataSourceID="odsAlgorithmClasses"> 20 </asp:ListBox> 21 22 <asp:ObjectDataSource ID="odsAlgorithmClasses" runat="server" 23 SelectMethod="AlgorithmClassGetAll" 24 TypeName="HLWebOKBAdminPlugin.Models.AdminModel"></asp:ObjectDataSource> 25 17 <asp:Button ID="Test" runat="server" Text="TestText" 18 onclick="Test_Click"/> 26 19 <p> 27 20 <%: Html.ActionLink("Create New", "Create") %> … … 29 22 30 23 </form> 31 32 24 </asp:Content> 33 -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Problem/Detail.aspx
r6153 r6162 72 72 <tr> 73 73 <td> 74 Plat tforms:74 Platform: 75 75 </td> 76 76 <td> 77 <select name="Plat tformId">78 <% foreach(Platform pc in ((ProblemModel)Model).Plat tforms) { %>77 <select name="PlatformId"> 78 <% foreach(Platform pc in ((ProblemModel)Model).Platforms) { %> 79 79 <% if(p.PlatformId == pc.Id) { %> 80 80 <option selected="selected" value="<%=pc.Id%>"><%=pc.Name%></option> -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Problem/Index.aspx
r6153 r6162 31 31 </td> 32 32 <td> 33 <%: Html.ActionLink("delete", "Detail",new {p.Id}) %>33 <%: Html.ActionLink("delete", "Delete",new {p.Id}) %> 34 34 </td> 35 35 </tr>
Note: See TracChangeset
for help on using the changeset viewer.