using MyWebApi.Models;
|
using MyWebApi.Tools;
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Data.SqlClient;
|
using System.Linq;
|
using System.Web;
|
|
namespace MyWebApi.DLL.DAL
|
{
|
public class LoadDataDAL
|
{
|
#region【业务逻辑层数据过度,流水线看板图型数据】
|
public static List<DataTable> LineData(string lineCode, string LineCodeList)
|
{
|
List<DataTable> list = new List<DataTable>();
|
//执行存储过程@lineCodeList
|
// 存储过程名称
|
string strProcName = "LineProduct_Radio";
|
//创建参数
|
SqlParameter[] parameters = { new SqlParameter("@lineCode", lineCode), new SqlParameter("@lineCodeList", LineCodeList) };
|
//parameters[0].Direction = ParameterDirection.Output;
|
list = DBHelper.ExecuteProductDataList(strProcName, parameters);
|
return list;
|
}
|
#endregion
|
|
#region【业务逻辑层数据过度,流水线看板列表数据】
|
public static List<LineWork> LineTableData(string LineCode, int startNum, int endNum, out int count)
|
{
|
//执行存储过程@lineCodeList
|
// 存储过程名称
|
string strProcName = "kb_LineProduct_Table";
|
//创建参数
|
SqlParameter[] parameters = {
|
new SqlParameter("@lineCode", LineCode),
|
new SqlParameter("@startNum", startNum),
|
new SqlParameter("@endNum", endNum),
|
new SqlParameter("@total", ParameterDirection.Output)
|
};
|
parameters[3].Direction = ParameterDirection.Output;
|
DataTable dt = DBHelper.ExecuteProductData(strProcName, parameters);
|
if (dt != null && dt.Rows.Count > 0)
|
{
|
count = Convert.ToInt32(parameters[3].Value);
|
return dt.AsEnumerable().Select(t => new LineWork(t)).ToList();
|
}
|
count = Convert.ToInt32(parameters[3].Value);
|
return new List<LineWork>();
|
}
|
#endregion
|
|
#region[仓库看板看板码表数据]
|
public static DataTable HouseTopData(string houseCode)
|
{
|
//执行存储过程@lineCodeList
|
// 存储过程名称
|
string strProcName = "kb_HouseProduct_Radio";
|
//创建参数
|
SqlParameter[] parameters = { new SqlParameter("@HouseCode", houseCode) };
|
//parameters[0].Direction = ParameterDirection.Output;
|
DataTable dt = DBHelper.ExecuteProductData(strProcName, parameters);
|
return dt;
|
}
|
#endregion
|
|
#region[仓库看板看板详情数据]
|
public static DataTable HouseDataTable(string houseCode)
|
{
|
|
//执行存储过程@lineCodeList
|
// 存储过程名称
|
string strProcName = "kb_HouseProduct_Table";
|
//创建参数
|
SqlParameter[] parameters = { new SqlParameter("@HouseCode", houseCode) };
|
//parameters[0].Direction = ParameterDirection.Output;
|
DataTable dt = DBHelper.ExecuteProductData(strProcName, parameters);
|
return dt;
|
}
|
#endregion
|
|
public static List<CallTopTable> EquipMentData()
|
{
|
//执行存储过程@lineCodeList
|
// 存储过程名称
|
string strProcName = "select 20 as HICMOBillNO , '60%' as HNUMBER ,12 as HNAME, 4 HMODEL ,2 as HQTY ,1 as HLEFT ,1 as HSTATUS";
|
//创建参数
|
//parameters[0].Direction = ParameterDirection.Output;
|
DataTable dt = DBHelper.GetTable(strProcName);
|
if (dt != null && dt.Rows.Count > 0)
|
{
|
return dt.AsEnumerable().Select(t => new CallTopTable(t)).ToList();
|
}
|
return new List<CallTopTable>();
|
}
|
|
|
#region[叫料看板上列表数据]
|
public static List<CallTopTable> CallTableTopData(string CallHouseCode, int startNum, int endNum, out int count)
|
{
|
//执行存储过程@lineCodeList
|
// 存储过程名称
|
string strProcName = "kb_CallProduct_Table1";
|
//创建参数
|
SqlParameter[] parameters = {
|
new SqlParameter("@lineCode", CallHouseCode),
|
new SqlParameter("@startNum", startNum),
|
new SqlParameter("@endNum", endNum),
|
new SqlParameter("@total", ParameterDirection.Output)
|
};
|
parameters[3].Direction = ParameterDirection.Output;
|
DataTable dt = DBHelper.ExecuteProductData(strProcName, parameters);
|
if (dt != null && dt.Rows.Count > 0)
|
{
|
count = Convert.ToInt32(parameters[3].Value);
|
return dt.AsEnumerable().Select(t => new CallTopTable(t)).ToList();
|
}
|
count = Convert.ToInt32(parameters[3].Value);
|
return new List<CallTopTable>();
|
}
|
#endregion
|
|
#region[叫料看板下列表数据]
|
public static List<CallBottomTable> CallTableBottomData(string CallHouseCode, int startNum, int endNum, out int count)
|
{
|
List<CallBottomTable> list = new List<CallBottomTable>();
|
//执行存储过程@lineCodeList
|
// 存储过程名称
|
string strProcName = "kb_CallProduct_Table2";
|
//创建参数
|
SqlParameter[] parameters = {
|
new SqlParameter("@lineCode", CallHouseCode),
|
new SqlParameter("@startNum", startNum),
|
new SqlParameter("@endNum", endNum),
|
new SqlParameter("@total", ParameterDirection.Output)
|
};
|
parameters[3].Direction = ParameterDirection.Output;
|
DataTable dt = DBHelper.ExecuteProductData(strProcName, parameters);
|
if (dt != null && dt.Rows.Count > 0)
|
{
|
count = Convert.ToInt32(parameters[3].Value);
|
return dt.AsEnumerable().Select(t => new CallBottomTable(t)).ToList();
|
}
|
count = Convert.ToInt32(parameters[3].Value);
|
return new List<CallBottomTable>();
|
}
|
#endregion
|
|
#region[叫料看板图型展示数据]
|
public static List<DataTable> CallData(string CallHouseCode)
|
{
|
List<DataTable> list = new List<DataTable>();
|
//执行存储过程@kb_CallProduct_Data
|
// 存储过程名称
|
string strProcName = "kb_CallProduct_Data";
|
//创建参数
|
SqlParameter[] parameters = { new SqlParameter("@HouseCode", CallHouseCode) };
|
//parameters[0].Direction = ParameterDirection.Output;
|
list = DBHelper.ExecuteProductDataList(strProcName, parameters);
|
return list;
|
}
|
#endregion
|
|
#region 地图数据看板
|
/// <summary>
|
/// 地图数据看板
|
/// </summary>
|
/// <returns></returns>
|
public static List<DataTable> MyMap ()
|
{
|
List<DataTable> list = new List<DataTable>();
|
//执行存储过程h_p_Xs_SeOrderQtySort
|
// 存储过程名称
|
string strProcName = "h_p_Xs_SeOrderQtySort";
|
//创建参数
|
SqlParameter[] parameters = {};
|
list = DBHelper.ExecuteProductDataList(strProcName, parameters);
|
|
return list;
|
}
|
#endregion
|
}
|
}
|