From 6236e9ac740c68c7518e8e6d39dffeda0c627c32 Mon Sep 17 00:00:00 2001
From: ouyangqing <ouyangqing@DESKTOP-B85SG1D>
Date: 星期二, 19 一月 2021 14:43:10 +0800
Subject: [PATCH] form
---
WebAPI/Controllers/NewApiController.cs | 83 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 81 insertions(+), 2 deletions(-)
diff --git a/WebAPI/Controllers/NewApiController.cs b/WebAPI/Controllers/NewApiController.cs
index d272d15..504fce4 100644
--- a/WebAPI/Controllers/NewApiController.cs
+++ b/WebAPI/Controllers/NewApiController.cs
@@ -4,6 +4,7 @@
using System.Linq;
using System.Net;
using System.Net.Http;
+using System.Web;
using System.Web.Http;
using WebAPI.Models;
using WebAPI.Service;
@@ -97,9 +98,87 @@
/// <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>
/// 鍑虹珯绔欐帴鏀跺崟
--
Gitblit v1.9.1