修改采购入库单

This commit is contained in:
admin
2021-01-09 16:36:17 +08:00
parent fd3fc7af4c
commit cbd3c4555a
11 changed files with 262 additions and 130 deletions

View File

@@ -1,4 +1,6 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
@@ -28,16 +30,31 @@ namespace NX.ERP.WebAPi
public static void Register(HttpConfiguration config)
{
// Web API 配置和服务
GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings = new JsonSerializerSettings
{
//忽略循环引用,如果设置为Error,则遇到循环引用的时候报错
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
Formatting = Newtonsoft.Json.Formatting.Indented,
//小驼峰命名法
ContractResolver = new DefaultContractResolver() {
NamingStrategy = new SnakeCaseNamingStrategy()
}
//格式化日期时间
//空值处理
//NullValueHandling = NullValueHandling.Ignore
};
// Web API 路由
config.MapHttpAttributeRoutes();
var jsonFormatter = new JsonMediaTypeFormatter();
config.Services.Replace(typeof(IContentNegotiator), new JsonContentNegotiator(jsonFormatter));
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional }
routeTemplate: "api/{controller}/{action}/{code}",
defaults: new { code = RouteParameter.Optional }
);
}
}

View File

@@ -9,6 +9,7 @@ namespace NX.ERP.WebAPi.Controllers
{
public class ArrivalController : ApiController
{
// GET api/values
[HttpGet]
public IEnumerable<Model.Purchase.Arrival> List()
@@ -18,5 +19,13 @@ namespace NX.ERP.WebAPi.Controllers
}
[HttpGet]
public Model.Purchase.Arrival Model(string Code)
{
var customerDAL = new ArrivalDAL();
return customerDAL.GetModel(Code);
}
}
}