1 | <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
|
---|
2 |
|
---|
3 | <%@ Import Namespace="HLWebOKBAdminPlugin.Models" %>
|
---|
4 | <%@ Import Namespace="HLWebOKBAdminPlugin.OKBAdministrationService" %>
|
---|
5 | <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
|
---|
6 | Detail
|
---|
7 | </asp:Content>
|
---|
8 | <asp:Content ID="Content3" runat="server" ContentPlaceHolderID="SubMenuContent">
|
---|
9 | <% Html.RenderAction("Menu", "Admin"); %>
|
---|
10 | </asp:Content>
|
---|
11 | <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
|
---|
12 | <% using(Html.BeginForm("SaveChanges", "Problem")) %>
|
---|
13 | <% { %>
|
---|
14 | <h2>
|
---|
15 | Detail</h2>
|
---|
16 | <%
|
---|
17 |
|
---|
18 | // The Model will be filled via the Controller
|
---|
19 | // Maybe we can use here the Problem instead
|
---|
20 | // of the ProblemModel. But this must be changed
|
---|
21 | // in the Controller too!
|
---|
22 |
|
---|
23 | Problem p = ((ProblemModel)Model).Problem;
|
---|
24 | %>
|
---|
25 | <table border="1">
|
---|
26 | <tr>
|
---|
27 | <td>
|
---|
28 | Id:
|
---|
29 | </td>
|
---|
30 | <td>
|
---|
31 | <%: Html.Label(p.Id.ToString())%>
|
---|
32 | </td>
|
---|
33 | <%: Html.Hidden("ProblemId", p.Id.ToString(), p.Id.ToString())%>
|
---|
34 | </tr>
|
---|
35 | <tr>
|
---|
36 | <td>
|
---|
37 | Name:
|
---|
38 | </td>
|
---|
39 | <td>
|
---|
40 | <%: Html.TextBox("ProblemName", p.Name, p.Name)%>
|
---|
41 | </td>
|
---|
42 | </tr>
|
---|
43 | <tr>
|
---|
44 | <td>
|
---|
45 | Description:
|
---|
46 | </td>
|
---|
47 | <td>
|
---|
48 | <%: Html.TextBox("ProblemDescription", p.Description, p.Description)%>
|
---|
49 | </td>
|
---|
50 | </tr>
|
---|
51 | <tr>
|
---|
52 | <td>
|
---|
53 | DataTypeName:
|
---|
54 | </td>
|
---|
55 | <td>
|
---|
56 | <%: Html.TextBox("ProblemDataTypeName", p.DataTypeName, p.DataTypeName)%>
|
---|
57 | </td>
|
---|
58 | </tr>
|
---|
59 | <tr>
|
---|
60 | <td>
|
---|
61 | Problem Class:
|
---|
62 | </td>
|
---|
63 | <td>
|
---|
64 | <select name="ProblemClassId">
|
---|
65 | <% foreach(ProblemClass pc in ((ProblemModel)Model).ProblemClasses) { %>
|
---|
66 | <% if(p.ProblemClassId == pc.Id) { %>
|
---|
67 | <option selected="selected" value="<%=pc.Id%>"><%=pc.Name%></option>
|
---|
68 | <% } else { %>
|
---|
69 | <option value="<%=pc.Id%>"><%=pc.Name%></option>
|
---|
70 | <% } %>
|
---|
71 | <% } %>
|
---|
72 | </select>
|
---|
73 | </td>
|
---|
74 | </tr>
|
---|
75 | <tr>
|
---|
76 | <td>
|
---|
77 | Platform:
|
---|
78 | </td>
|
---|
79 | <td>
|
---|
80 | <select name="PlatformId">
|
---|
81 | <% foreach(Platform pc in ((ProblemModel)Model).Platforms) { %>
|
---|
82 | <% if(p.PlatformId == pc.Id) { %>
|
---|
83 | <option selected="selected" value="<%=pc.Id%>"><%=pc.Name%></option>
|
---|
84 | <% } else { %>
|
---|
85 | <option value="<%=pc.Id%>"><%=pc.Name%></option>
|
---|
86 | <% } %>
|
---|
87 | <% } %>
|
---|
88 | </select>
|
---|
89 | </td>
|
---|
90 | </tr>
|
---|
91 | <tr>
|
---|
92 | <td>
|
---|
93 | Action:
|
---|
94 | </td>
|
---|
95 | <td>
|
---|
96 | <input type="submit" value="save" />
|
---|
97 | </td>
|
---|
98 | </tr>
|
---|
99 | </table>
|
---|
100 |
|
---|
101 | <% } %>
|
---|
102 |
|
---|
103 | <% using (Html.BeginForm("UploadFile", "Problem", FormMethod.Post, new { enctype = "multipart/form-data" }))
|
---|
104 | {%><br />
|
---|
105 | <% Problem p = ((ProblemModel)Model).Problem; %>
|
---|
106 | <table border="1">
|
---|
107 | <tr>
|
---|
108 | <td>
|
---|
109 | File:
|
---|
110 | </td>
|
---|
111 | <td>
|
---|
112 | <%: Html.Hidden("ProblemId", p.Id.ToString(), p.Id.ToString()) %>
|
---|
113 | <input type="file" name="files" id="file2" size="25" />
|
---|
114 | </td>
|
---|
115 | </tr>
|
---|
116 | <tr>
|
---|
117 | <td>
|
---|
118 | Action:
|
---|
119 | </td>
|
---|
120 | <td>
|
---|
121 | <input type="submit" value="Upload file" />
|
---|
122 | </td>
|
---|
123 | </tr>
|
---|
124 | </table>
|
---|
125 | <%: Html.ActionLink("back to Index","Index") %>
|
---|
126 | <% } %>
|
---|
127 |
|
---|
128 |
|
---|
129 | </asp:Content>
|
---|