| | |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | using WebAPI.Service; |
| | |
| | | /// <returns></returns> |
| | | [Route("api/newBill/setStationInBill")] |
| | | [HttpPost] |
| | | public ApiResult SetStationInBill(ClsSc_StationInBillMain oMain) |
| | | public ApiResult SetStationInBill() |
| | | { |
| | | return YqnQbService.SetStationInBill(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(); |
| | | } |
| | | |
| | | 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 (request.Form["HMaterID"] != null) |
| | | { |
| | | 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> |
| | | /// 出站站接收单 |