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 LineData(string lineCode, string LineCodeList) { List list = new List(); //执行存储过程@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 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(); } #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 #region[叫料看板上列表数据] public static List 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(); } #endregion #region[叫料看板下列表数据] public static List CallTableBottomData(string CallHouseCode, int startNum, int endNum, out int count) { List list = new List(); //执行存储过程@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(); } #endregion #region[叫料看板图型展示数据] public static List CallData(string CallHouseCode) { List list = new List(); //执行存储过程@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 地图数据看板 /// /// 地图数据看板 /// /// public static List MyMap () { List list = new List(); //执行存储过程h_p_Xs_SeOrderQtySort // 存储过程名称 string strProcName = "h_p_Xs_SeOrderQtySort"; //创建参数 SqlParameter[] parameters = {}; list = DBHelper.ExecuteProductDataList(strProcName, parameters); return list; } #endregion } }