Changeset 6246
- Timestamp:
- 05/21/11 22:07:58 (14 years ago)
- Location:
- branches/WebApplication/MVC2/HLWebOKBAdminPlugin
- Files:
-
- 8 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AdminController.cs
r6218 r6246 6 6 using System.Web.Security; 7 7 using System.ServiceModel.Security; 8 //using HLWebPluginHost.OKBService;9 8 using System.Diagnostics; 10 9 using HLWebOKBAdminPlugin.OKBAdministrationService; -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AlgorithmController.cs
r6213 r6246 6 6 using HLWebOKBAdminPlugin.Models; 7 7 using HLWebOKBAdminPlugin.OKBAdministrationService; 8 using System.IO; 8 9 9 10 namespace HLWebOKBAdminPlugin.Controllers … … 79 80 } 80 81 82 public ActionResult UploadFile(FormCollection collection) { 83 Session["SelectedSubMenu"] = "Algorithm"; 84 85 long algorithmId = long.Parse(collection.Get("AlgorithmId")); 86 87 AlgorithmModel pm = new AlgorithmModel(); 88 89 foreach (string inputTagName in Request.Files) { 90 HttpPostedFileBase file = Request.Files[inputTagName]; 91 if (file.ContentLength > 0) { 92 // maybe for storage on server 93 //string filePath = Path.Combine(HttpContext.Server.MapPath("../Uploads"), Path.GetFileName(file.FileName)); 94 if (file.InputStream.CanRead) { 95 //file length 96 int fileLength = file.ContentLength; 97 98 //bytearray 99 byte[] data = new byte[fileLength]; 100 101 //initialize input stream 102 Stream dataStream = file.InputStream; 103 104 //read file into byte array 105 dataStream.Read(data, 0, fileLength); 106 107 //save data 108 pm.UpdateAlgorithmData(algorithmId, data); 109 }//if 110 } 111 }//foreach 112 113 return View("Index", pm); 114 }//UploadFile 115 81 116 /// <summary> 82 117 /// Controller for Detail View -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemController.cs
r6213 r6246 6 6 using HLWebOKBAdminPlugin.Models; 7 7 using HLWebOKBAdminPlugin.OKBAdministrationService; 8 using System.IO; 8 9 9 10 namespace HLWebOKBAdminPlugin.Controllers … … 88 89 return View("Index", pm); 89 90 } 91 92 public ActionResult UploadFile(FormCollection collection) { 93 Session["SelectedSubMenu"] = "Problem"; 94 95 long problemId = long.Parse(collection.Get("ProblemId")); 96 97 ProblemModel pm = new ProblemModel(); 98 99 foreach (string inputTagName in Request.Files) { 100 HttpPostedFileBase file = Request.Files[inputTagName]; 101 if (file.ContentLength > 0) { 102 // maybe for storage on server 103 //string filePath = Path.Combine(HttpContext.Server.MapPath("../Uploads"), Path.GetFileName(file.FileName)); 104 if (file.InputStream.CanRead) { 105 //file length 106 int fileLength = file.ContentLength; 107 108 //bytearray 109 byte[] data = new byte[fileLength]; 110 111 //initialize input stream 112 Stream dataStream = file.InputStream; 113 114 //read file into byte array 115 dataStream.Read(data, 0, fileLength); 116 117 //save data 118 pm.UpdateProblemData(problemId, data); 119 }//if 120 } 121 }//foreach 122 123 return View("Index", pm); 124 }//UploadFile 90 125 91 126 /// <summary> -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/HLWebOKBAdminPlugin.csproj
r6218 r6246 88 88 <ItemGroup> 89 89 <Compile Include="Controllers\AdminController.cs" /> 90 <Compile Include="Controllers\AlgorithmClassController.cs" /> 90 91 <Compile Include="Controllers\AlgorithmController.cs" /> 91 92 <Compile Include="Controllers\HomeController.cs" /> 93 <Compile Include="Controllers\ProblemClassController.cs" /> 92 94 <Compile Include="Controllers\ProblemController.cs" /> 93 95 <Compile Include="Global.asax.cs"> … … 100 102 <Compile Include="Models\AlgorithmClassModel.cs" /> 101 103 <Compile Include="Models\AlgorithmModel.cs" /> 104 <Compile Include="Models\ProblemClassModel.cs" /> 102 105 <Compile Include="Models\ProblemModel.cs" /> 103 106 <Compile Include="Properties\AssemblyInfo.cs" /> … … 143 146 <Content Include="Views\Admin\Problem.aspx" /> 144 147 <Content Include="Views\Admin\ProblemClass.aspx" /> 148 <Content Include="Views\AlgorithmClass\Detail.aspx" /> 149 <Content Include="Views\AlgorithmClass\Index.aspx" /> 145 150 <Content Include="Views\Algorithm\Detail.aspx" /> 146 151 <Content Include="Views\Algorithm\Index.aspx" /> 147 152 <Content Include="Views\Home\About.aspx" /> 148 153 <Content Include="Views\Home\Index.aspx" /> 154 <Content Include="Views\ProblemClass\Detail.aspx" /> 155 <Content Include="Views\ProblemClass\Index.aspx" /> 149 156 <Content Include="Views\Problem\Detail.aspx" /> 150 157 <Content Include="Views\Problem\Index.aspx" /> -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/AdminModel.cs
r6218 r6246 232 232 return 0; 233 233 }//SaveProblem 234 235 234 236 } 235 237 } -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/AlgorithmClassModel.cs
r6161 r6246 12 12 13 13 public String SelectedSubMenu { get; set; } 14 public IList<AlgorithmClass> AlgorithmClasses { get { return AlgorithmClassGetAll(); } } 14 public IList<AlgorithmClass> AlgorithmClasses { 15 get { return AlgorithmClassGetAll(); } 16 set { ;} 17 } 15 18 16 19 public AlgorithmClass AlgorithmClass { get; set; } -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/AlgorithmModel.cs
r6213 r6246 105 105 return 0; 106 106 }//SaveAlgorithm 107 108 public void UpdateAlgorithmData(long id, byte[] data) { 109 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 110 111 if (adminClient != null) { 112 adminClient.UpdateAlgorithmData(id, data); 113 } 114 }//UpdateProblemData 107 115 } 108 116 } -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/ProblemClassModel.cs
r6161 r6246 10 10 11 11 public String SelectedSubMenu { get; set; } 12 public IList<ProblemClass> ProblemClasses { get { return ProblemClassGetAll(); } } 12 public IList<ProblemClass> ProblemClasses { 13 get { return ProblemClassGetAll();} 14 set {;} 15 } 13 16 14 17 public ProblemClass ProblemClass { get; set; } -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/ProblemModel.cs
r6213 r6246 108 108 return 0; 109 109 }//SaveProblem 110 111 public void UpdateProblemData(long id, byte[] data) { 112 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 113 114 if (adminClient != null) { 115 adminClient.UpdateProblemData(id, data); 116 } 117 }//UpdateProblemData 110 118 } 111 119 } -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Admin/Algorithm.aspx
r6117 r6246 1 1 <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 3 <asp:Content ID="Content3" runat="server" ContentPlaceHolderID="SubMenuContent">4 <% Html.RenderAction("Menu"); %>5 </asp:Content>6 2 7 3 <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Admin/AlgorithmClass.aspx
r6162 r6246 9 9 <h2> 10 10 AlgorithmClass</h2> 11 < asp:ListBox ID="lbxAlgorithmClasses" runat="server" DataTextField="Name" DataValueField="Id"11 <%--<asp:ListBox ID="lbxAlgorithmClasses" runat="server" DataTextField="Name" DataValueField="Id" 12 12 Height="350px" Style="margin-top: 0px" Width="240px" DataSourceID="odsAlgorithmClasses"> 13 13 </asp:ListBox> … … 19 19 <p> 20 20 <%: Html.ActionLink("Create New", "Create") %> 21 </p> 21 </p>--%> 22 22 23 23 </form> -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Admin/Menu.ascx
r6213 r6246 3 3 <ul> 4 4 <li <% if(Session["SelectedSubMenu"] == "AlgorithmClass") {%> class="selected" <%}%>> 5 <%: Html.ActionLink("AlgorithmClass", " AlgorithmClass", "Admin")%>5 <%: Html.ActionLink("AlgorithmClass", "Index", "AlgorithmClassPlgin")%> 6 6 </li> 7 7 <li <% if(Session["SelectedSubMenu"] == "Algorithm") {%> class="selected" <%}%>> … … 9 9 </li> 10 10 <li <% if(Session["SelectedSubMenu"] == "ProblemClass") {%> class="selected" <%}%>> 11 <%: Html.ActionLink("ProblemClass", " ProblemClass", "Admin")%>11 <%: Html.ActionLink("ProblemClass", "Index", "ProblemClass")%> 12 12 </li> 13 13 <li <% if(Session["SelectedSubMenu"] == "Problem") {%> class="selected" <%}%>> -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Admin/Problem.aspx
r6050 r6246 1 1 <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 2 3 4 <asp:Content ID="Content3" runat="server" ContentPlaceHolderID="SubMenuContent">5 <% Html.RenderAction("Menu"); %>6 </asp:Content>7 3 8 4 <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Admin/ProblemClass.aspx
r6050 r6246 1 1 <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 3 <asp:Content ID="Content3" runat="server" ContentPlaceHolderID="SubMenuContent">4 <% Html.RenderAction("Menu"); %>5 </asp:Content>6 2 7 3 <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Problem/Detail.aspx
r6162 r6246 95 95 </tr> 96 96 </table> 97 <%: Html.ActionLink("back to Index","Index") %>97 98 98 <% } %> 99 100 <% using (Html.BeginForm("UploadFile", "Problem", FormMethod.Post, new { enctype = "multipart/form-data" })) 101 {%><br /> 102 <% Problem p = ((ProblemModel)Model).Problem; %> 103 <table border="1"> 104 <tr> 105 <td> 106 File: 107 </td> 108 <td> 109 <%: Html.Hidden("ProblemId", p.Id.ToString(), p.Id.ToString()) %> 110 <input type="file" name="files" id="file2" size="25" /> 111 </td> 112 </tr> 113 <tr> 114 <td> 115 Action: 116 </td> 117 <td> 118 <input type="submit" value="Upload file" /> 119 </td> 120 </tr> 121 </table> 122 <%: Html.ActionLink("back to Index","Index") %> 123 <% } %> 124 125 99 126 </asp:Content> -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Problem/Index.aspx
r6162 r6246 22 22 <tr> 23 23 <td> 24 <%: Html. ActionLink(p.Name, "Detail",new {p.Id})%>24 <%: Html.Label(p.Name)%> 25 25 </td> 26 26 <td> … … 29 29 <td> 30 30 <%: Html.Label(p.DataTypeName)%> 31 </td> 32 <td> 33 <%: Html.ActionLink("detail", "Detail", new { p.Id })%> 31 34 </td> 32 35 <td> -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Web.config
r6218 r6246 126 126 </security> 127 127 </binding> 128 <binding name="AdministrationService3" closeTimeout="00:01:00" 129 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 130 bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 131 maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" 132 textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> 133 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 134 maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 135 <reliableSession ordered="true" inactivityTimeout="00:10:00" 136 enabled="false" /> 137 <security mode="Message"> 138 <transport clientCredentialType="Windows" proxyCredentialType="None" 139 realm="" /> 140 <message clientCredentialType="UserName" negotiateServiceCredential="true" 141 algorithmSuite="Default" /> 142 </security> 143 </binding> 128 144 </wsHttpBinding> 129 145 </bindings> … … 150 166 </identity> 151 167 </endpoint> 168 <endpoint address="http://services.heuristiclab.com/OKB.SPR-3.3/AdministrationService.svc" 169 binding="wsHttpBinding" bindingConfiguration="AdministrationService3" 170 contract="OKBAdministrationService.IAdministrationService" name="AdministrationService3"> 171 <identity> 172 <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ==" /> 173 </identity> 174 </endpoint> 152 175 </client> 153 176 </system.serviceModel>
Note: See TracChangeset
for help on using the changeset viewer.