修正名称的错误
This commit is contained in:
@@ -17,21 +17,21 @@ using System.Web.Http.Filters;
|
||||
namespace NX.ERP.WebAPi
|
||||
{
|
||||
|
||||
//public class JsonContentNegotiator : IContentNegotiator
|
||||
//{
|
||||
// private readonly JsonMediaTypeFormatter _jsonFormatter;
|
||||
public class JsonContentNegotiator : IContentNegotiator
|
||||
{
|
||||
private readonly JsonMediaTypeFormatter _jsonFormatter;
|
||||
|
||||
// public JsonContentNegotiator(JsonMediaTypeFormatter formatter)
|
||||
// {
|
||||
// _jsonFormatter = formatter;
|
||||
// }
|
||||
public JsonContentNegotiator(JsonMediaTypeFormatter formatter)
|
||||
{
|
||||
_jsonFormatter = formatter;
|
||||
}
|
||||
|
||||
// public ContentNegotiationResult Negotiate(Type type, HttpRequestMessage request, IEnumerable<MediaTypeFormatter> formatters)
|
||||
// {
|
||||
// var result = new ContentNegotiationResult(_jsonFormatter, new MediaTypeHeaderValue("application/json"));
|
||||
// return result;
|
||||
// }
|
||||
//}
|
||||
public ContentNegotiationResult Negotiate(Type type, HttpRequestMessage request, IEnumerable<MediaTypeFormatter> formatters)
|
||||
{
|
||||
var result = new ContentNegotiationResult(_jsonFormatter, new MediaTypeHeaderValue("application/json"));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
public static class WebApiConfig
|
||||
{
|
||||
public static void Register(HttpConfiguration config)
|
||||
@@ -45,6 +45,8 @@ namespace NX.ERP.WebAPi
|
||||
NX.ERP.U8.U8LoginContext.Instance.Server= System.Configuration.ConfigurationManager.AppSettings["Server"];
|
||||
|
||||
|
||||
//optional: set serializer settings here
|
||||
|
||||
//System.Web.Http.Filters.IExceptionFilter
|
||||
config.Filters.Add(new ExceptionFilter());
|
||||
config.Filters.Add(new ApiResultAttribute());
|
||||
|
||||
@@ -8,23 +8,23 @@ using System.Web.Http;
|
||||
|
||||
namespace NX.ERP.WebAPi.Controllers
|
||||
{
|
||||
public class MaterielController : ApiController
|
||||
public class MaterialController : ApiController
|
||||
{
|
||||
[Obsolete]
|
||||
[Route("api/Materiel/List")]
|
||||
[Route("api/Material/List")]
|
||||
[HttpGet]
|
||||
public IEnumerable<Materiel> List()
|
||||
public IEnumerable<Material> List()
|
||||
{
|
||||
var materielDAL = new MaterielDAL();
|
||||
return materielDAL.GetList();
|
||||
var MaterialDAL = new MaterialDAL();
|
||||
return MaterialDAL.GetList();
|
||||
|
||||
}
|
||||
[Route("api/Materiel/Query")]
|
||||
[Route("api/Material/Query")]
|
||||
[HttpPost]
|
||||
public IEnumerable<Materiel> Query(NX.ERP.Model.Request.Materiel Param)
|
||||
public IEnumerable<Material> Query(NX.ERP.Model.Request.Material Param)
|
||||
{
|
||||
var materielDAL = new MaterielDAL();
|
||||
return materielDAL.GetList(Param);
|
||||
var MaterialDAL = new MaterialDAL();
|
||||
return MaterialDAL.GetList(Param);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,23 +8,23 @@ using System.Web.Http;
|
||||
|
||||
namespace NX.ERP.WebAPi.Controllers
|
||||
{
|
||||
public class MaterielTypeController:ApiController
|
||||
public class MaterialTypeController:ApiController
|
||||
{
|
||||
[Obsolete]
|
||||
[Route("api/MaterielType/List")]
|
||||
[Route("api/MaterialType/List")]
|
||||
[HttpGet]
|
||||
public IEnumerable<MaterielType> List()
|
||||
public IEnumerable<MaterialType> List()
|
||||
{
|
||||
var materielType = new MaterielTypeDAL();
|
||||
return materielType.GetList();
|
||||
var MaterialType = new MaterialTypeDAL();
|
||||
return MaterialType.GetList();
|
||||
|
||||
}
|
||||
[Route("api/MaterielType/Query")]
|
||||
[Route("api/MaterialType/Query")]
|
||||
[HttpPost]
|
||||
public IEnumerable<MaterielType> Query(NX.ERP.Model.Request.MaterielType Param)
|
||||
public IEnumerable<MaterialType> Query(NX.ERP.Model.Request.MaterialType Param)
|
||||
{
|
||||
var materielType = new MaterielTypeDAL();
|
||||
return materielType.GetList(Param);
|
||||
var MaterialType = new MaterialTypeDAL();
|
||||
return MaterialType.GetList(Param);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,15 +7,15 @@ using System.Web.Http;
|
||||
namespace NX.ERP.WebAPi.Controllers.Store
|
||||
{
|
||||
|
||||
public class MaterielStoreOutController:ApiController
|
||||
public class MaterialStoreOutController:ApiController
|
||||
{
|
||||
[Obsolete]
|
||||
[Route("api/MaterialOut/Add")]
|
||||
[HttpPost]
|
||||
|
||||
public string AddVoucher([FromBody] Model.Request.MaterielStoreOut storeIn)
|
||||
public string AddVoucher([FromBody] Model.Request.MaterialStoreOut storeIn)
|
||||
{
|
||||
var dal = new NX.ERP.U8.Store.MaterielStoreOutDAL();
|
||||
var dal = new NX.ERP.U8.Store.MaterialStoreOutDAL();
|
||||
return dal.AddVocher(storeIn);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user