using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using Warehouse.DAL.ShipmentsReportDal; using Warehouse.DAL.Report; using System.Text.RegularExpressions; namespace Warehouse.WebApi { public class ShipmentsReportController : ApiController { ShipmentsReportDal DT = new ShipmentsReportDal(); [Route("api/ShipmentsReport/ShipmentsReports")] [HttpPost] public IHttpActionResult QueryInfo(dynamic para) { string workorder = para.workorder; string workshop = para.workshop; string product_code = para.product_code; string behintime = para.behintime; string endtime = para.endtime; string power_grade = para.power_grade; string containerno_old = para.containerno; string trim =String.Empty; if (containerno_old != null) { trim = Regex.Replace(containerno_old, @"\s", " "); } string containerno = "'"+ trim.Replace(" ","','")+"'"; var res = DT.ShipmentsReport(behintime, endtime, workshop, product_code, power_grade,containerno); return Json(res); } } }