Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6162


Ignore:
Timestamp:
05/07/11 15:35:44 (12 years ago)
Author:
gschwarz
Message:

#1433 Updated Problem Control/View

Location:
branches/WebApplication/MVC2/HLWebOKBAdminPlugin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemController.cs

    r6159 r6162  
    2525    }
    2626
     27        /// <summary>
     28        /// Controller for Index View
     29        /// </summary>
     30        /// <returns></returns>
    2731        public ActionResult SortAsc() {
    2832            Session["SelectedSubMenu"] = "Problem";
    2933            ProblemModel pm = new ProblemModel();
    30             pm.Problems.OrderBy(x => x.Name);
     34            pm.Problems = pm.Problems.OrderBy(x => x.Name).ToList<Problem>();
    3135            return View("Index",pm);
    3236        }
    3337
     38        /// <summary>
     39        /// Controller for Index View
     40        /// </summary>
     41        /// <returns></returns>
    3442        public ActionResult SortDesc() {
    3543            Session["SelectedSubMenu"] = "Problem";
    3644            ProblemModel pm = new ProblemModel();
    37             pm.Problems.OrderByDescending(x => x.Name);
     45            pm.Problems = pm.Problems.OrderByDescending(x => x.Name).ToArray<Problem>();
    3846            return View("Index",pm);
    3947        }
     
    5664    }
    5765
     66        /// <summary>
     67        /// Controller for Index View
     68        /// </summary>
     69        /// <returns></returns>
    5870        public ActionResult Delete(long id) {
    5971            Session["SelectedSubMenu"] = "Problem";
     
    6274            ProblemModel pm = new ProblemModel();
    6375            if(id != 0) {
    64                 pm.Problem = (Problem)pm.Problems.Where(x => x.Id.Equals(id)).FirstOrDefault();
    65 //                pm.DeleteProblem();
     76                pm.DeleteProblem(id);
    6677            }
    67             return View(pm);
     78            return View("Index", pm);
    6879        }
    6980
     81        /// <summary>
     82        /// Controller for Detail View
     83        /// </summary>
     84        /// <returns></returns>
    7085        public ActionResult SaveChanges(FormCollection collection) {           
    7186            long problemId = long.Parse(collection.Get("ProblemId"));
     
    7893            // Later, we will get the runs from the session ...
    7994            ProblemModel pm = new ProblemModel();
    80             if( problemId != 0 )
     95            if(problemId != 0)
    8196                pm.Problem = (Problem)pm.Problems.Where(x => x.Id.Equals(problemId)).FirstOrDefault();
    8297
     
    8499            pm.Problem.Description = problemDescription;
    85100            pm.Problem.DataTypeName = problemDataTypeName;
     101            pm.Problem.DataTypeTypeName = "";
    86102            pm.Problem.ProblemClassId = problemClassId;
    87103            pm.Problem.PlatformId = platformId;
  • branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Admin/AlgorithmClass.aspx

    r6050 r6162  
    11<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
    22
    3 <asp:Content ID="Content3" runat="server" ContentPlaceHolderID="SubMenuContent">
    4    <% Html.RenderAction("Menu"); %>
    5 </asp:Content>
    63
    74<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    8   AlgorithmClass
     5    AlgorithmClass
    96</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>
    1016
    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"/>
    2619    <p>
    2720        <%: Html.ActionLink("Create New", "Create") %>
     
    2922
    3023    </form>
    31 
    3224</asp:Content>
    33 
  • branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Problem/Detail.aspx

    r6153 r6162  
    7272        <tr>
    7373            <td>
    74                 Plattforms:
     74                Platform:
    7575            </td>
    7676            <td>
    77                 <select name="PlattformId">
    78                     <% foreach(Platform pc in ((ProblemModel)Model).Plattforms) {  %>
     77                <select name="PlatformId">
     78                    <% foreach(Platform pc in ((ProblemModel)Model).Platforms) {  %>
    7979                        <% if(p.PlatformId == pc.Id) { %>
    8080                            <option selected="selected" value="<%=pc.Id%>"><%=pc.Name%></option>
  • branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Problem/Index.aspx

    r6153 r6162  
    3131                </td>
    3232                <td>
    33                      <%: Html.ActionLink("delete", "Detail",new {p.Id}) %>
     33                    <%: Html.ActionLink("delete", "Delete",new {p.Id}) %>
    3434                </td>
    3535            </tr>
Note: See TracChangeset for help on using the changeset viewer.