WebAPI/App_Start/WebApiConfig.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/NewApiController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Web.config | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/WebAPI.csproj.user | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/packages.config | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
WebAPI/App_Start/WebApiConfig.cs
@@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Web.Http; using System.Web.Http.Cors; namespace WebAPI { @@ -13,7 +14,8 @@ GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear(); // Web API 路由 config.MapHttpAttributeRoutes(); var corsAttr = new EnableCorsAttribute("*", "*", "*"); config.EnableCors(corsAttr); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", WebAPI/Controllers/NewApiController.cs
@@ -2,9 +2,6 @@ using System.Collections.Generic; using System.Data; using System.Linq; using System.Net; using System.Net.Http; using System.Web; using System.Web.Http; using WebAPI.Models; using WebAPI.Service; @@ -98,89 +95,11 @@ /// <returns></returns> [Route("api/newBill/setStationInBill")] [HttpPost] [HttpGet] public ApiResult SetStationInBill() public ApiResult SetStationInBill(ClsSc_StationInBillMain oMain) { HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"];//获取传统context HttpRequestBase request = context.Request;//定义传统request对象 var omain = GetOMind(request); return YqnQbService.SetStationInBill(omain); } ClsSc_StationInBillMain GetOMind(HttpRequestBase request) { ClsSc_StationInBillMain oMain = new ClsSc_StationInBillMain(); if(request.Form["HAddr"]!=null) { oMain.HAddr = request.Form["HAddr"].ToString(); } if (request.Form["HBarCode"] != null) { oMain.HBarCode = request.Form["HBarCode"].ToString(); } if (request.Form["HProcExchBillNo"] != null) { oMain.HProcExchBillNo = request.Form["HProcExchBillNo"].ToString(); return YqnQbService.SetStationInBill(oMain); } if (!string.IsNullOrEmpty(request.Form["HProcID"])) { oMain.HProcID = long.Parse(request.Form["HProcID"].ToString()); } if (!string.IsNullOrEmpty(request.Form["HEmpID"])) { oMain.HEmpID =long.Parse(request.Form["HEmpID"].ToString()); } if (!string.IsNullOrEmpty(request.Form["HQty"])) { oMain.HQty =double.Parse(request.Form["HQty"].ToString()); } if (!string.IsNullOrEmpty(request.Form["HSourceID"])) { oMain.HSourceID =long.Parse(request.Form["HSourceID"].ToString()); } if (!string.IsNullOrEmpty(request.Form["HGroupID"])) { oMain.HGroupID =long.Parse(request.Form["HGroupID"].ToString()); } if (request.Form["HCenterID"] != null) { //oMain.HCenterID = request.Form["HCenterID"].ToString(); } if (request.Form["HBillNo"] != null) { oMain.HBillNo = request.Form["HBillNo"].ToString(); } if (!string.IsNullOrEmpty(request.Form["HInterID"])) { oMain.HInterID =long.Parse(request.Form["HInterID"].ToString()); } if (request.Form["HStationInTime"] != null) { oMain.HStationInTime =DateTime.Parse(request.Form["HStationInTime"].ToString()); } if (request.Form["HICMOBillNo"] != null) { oMain.HICMOBillNo = request.Form["HICMOBillNo"].ToString(); } if (!string.IsNullOrEmpty( request.Form["HMaterID"])) { oMain.HMaterID =long.Parse(request.Form["HMaterID"].ToString()); } if (!string.IsNullOrEmpty(request.Form["HICMOQty"])) { oMain.HICMOQty =double.Parse( request.Form["HICMOQty"].ToString()); } if (request.Form["HICMOInterID"] != null) { oMain.HICMOInterID =long.Parse( request.Form["HICMOInterID"].ToString()); } if (!string.IsNullOrEmpty(request.Form["HDeptID"])) { oMain.HDeptID = long.Parse(request.Form["HDeptID"].ToString()); } return oMain; } /// <summary> /// 出站站接收单 /// </summary> WebAPI/Web.config
@@ -9,6 +9,7 @@ <section name="WebAPI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </sectionGroup> </configSections> <appSettings> <add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Enabled" value="false" /> @@ -28,27 +29,20 @@ <httpRuntime /> <pages controlRenderingCompatibilityVersion="4.0" /> </system.web> <system.webServer> <handlers> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <!--<remove name="OPTIONSVerbHandler"/>--> <remove name="TRACEVerbHandler" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> </handlers> </system.webServer> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> @@ -75,4 +69,11 @@ </setting> </WebAPI.Properties.Settings> </applicationSettings> </configuration> <system.webServer> <handlers> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <remove name="OPTIONSVerbHandler" /> <remove name="TRACEVerbHandler" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> </handlers> </system.webServer></configuration> WebAPI/WebAPI.csproj
@@ -83,9 +83,8 @@ <SpecificVersion>False</SpecificVersion> <HintPath>DLL\Model.dll</HintPath> </Reference> <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>DLL\Newtonsoft.Json.dll</HintPath> <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath> </Reference> <Reference Include="Pub_Class, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> @@ -113,14 +112,16 @@ <Reference Include="System.Net.Http"> <Private>True</Private> </Reference> <Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>DLL\System.Net.Http.Formatting.dll</HintPath> <Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath> </Reference> <Reference Include="System.Runtime.Serialization"> <Private>True</Private> </Reference> <Reference Include="System.ServiceModel" /> <Reference Include="System.Web.Cors, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\packages\Microsoft.AspNet.Cors.5.2.7\lib\net45\System.Web.Cors.dll</HintPath> </Reference> <Reference Include="System.Web.DynamicData"> <Private>True</Private> </Reference> @@ -152,9 +153,11 @@ <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>DLL\System.Web.Http.dll</HintPath> <Reference Include="System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll</HintPath> </Reference> <Reference Include="System.Web.Http.Cors, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\packages\Microsoft.AspNet.WebApi.Cors.5.2.7\lib\net45\System.Web.Http.Cors.dll</HintPath> </Reference> <Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> WebAPI/WebAPI.csproj.user
@@ -8,7 +8,7 @@ <WebStackScaffolding_LayoutPageFile /> <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected> <NameOfLastUsedPublishProfile>PDAWeb</NameOfLastUsedPublishProfile> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <UseIISExpress>false</UseIISExpress> <Use64BitIISExpress /> <IISExpressSSLPort /> WebAPI/packages.config
@@ -4,14 +4,16 @@ <package id="bootstrap" version="3.0.0" targetFramework="net45" /> <package id="jQuery" version="1.10.2" targetFramework="net45" /> <package id="jQuery.Validation" version="1.11.1" targetFramework="net45" /> <package id="Microsoft.AspNet.Cors" version="5.2.7" targetFramework="net45" /> <package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" /> <package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" /> <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Client.zh-Hans" version="5.2.3" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Core.zh-Hans" version="5.2.3" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Client.zh-Hans" version="5.2.7" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Core" version="5.2.7" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Core.zh-Hans" version="5.2.7" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.Cors" version="5.2.7" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net45" /> <package id="Microsoft.AspNet.WebApi.WebHost.zh-Hans" version="5.2.3" targetFramework="net45" /> <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />