using DAL;
using DBUtility;
using Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI;
using WebAPI.Models;
using WebAPI.Service;
namespace WebAPI.Controllers
{
public class WEBSController : ApiController
{
public string sWhere = "";
public WebServer webserver = new WebServer();
public DataSet ds = new DataSet();
private json objjson = new json();
private json objJsonResult = new json();
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
public ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS();
public WebS.WebService1 oWebs = new WebS.WebService1();
public WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
#region 基础资料
#region 仓库资料
//根据仓库ID、组织ID,返回仓库信息
public Model.ClsGy_Warehouse_Model GetWhInfoByIDandOrg(long sHWhID, long HUSEORGID, ref string sErr)
{
DAL.ClsIF_Warehouse_View dal = new DAL.ClsIF_Warehouse_View();
if (dal.GetInfoByIDandOrgID(sHWhID, HUSEORGID))
{
return dal.omodel;
}
else
{
return null;
}
}
#endregion
#region 仓位资料
#endregion
#endregion
#region 界面控件功能调用方法
#region 根据单据类型获取单据子类型
///
/// 根据单据类型获取单据子类型
///
///
[Route("WEBSController/GetBillSubType_Json")]
[HttpGet]
public Object GetBillSubType_Json(string HBillType, Int64 HStockOrgID)
{
try
{
ds = oWebs.get_BillSubType(HBillType, HStockOrgID);
if (ds == null)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "查询不到单据子类型信息!";
objJsonResult.data = null;
return objJsonResult;
}
else
{
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "成功";
objJsonResult.data = ds.Tables[0];
return objJsonResult;
}
}
catch (Exception e)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "根据单据类型获取单据子类型信息失败!" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
#endregion
#endregion
#region 已上传查询界面,根据单据号、源单号查询已上传单据信息
///
/// 已上传查询界面,根据单据号、源单号查询已上传单据信息
///
///
[Route("WEBSController/GetKf_ICStockBillQueryList_Json")]
[HttpGet]
public object GetKf_ICStockBillQueryList_Json(string HBillType, string HBillNo, string HSourceBillNo)
{
try
{
ds = oWebs.GetKf_ICStockBillQueryList(HBillType, HBillNo, HSourceBillNo);
if (ds == null)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "查询不到该单据记录!";
objJsonResult.data = null;
return objJsonResult;
}
else
{
List