From ef207546d2ccc247f2af1aa74118ee9442655bbc Mon Sep 17 00:00:00 2001 From: 王 垚 <1402714037@qq.com> Date: 星期二, 06 九月 2022 15:36:41 +0800 Subject: [PATCH] 优化 --- MyWebApi/DLL/DAL/LoadDataDAL.cs | 85 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 83 insertions(+), 2 deletions(-) diff --git a/MyWebApi/DLL/DAL/LoadDataDAL.cs b/MyWebApi/DLL/DAL/LoadDataDAL.cs index 6d7199a..1fa3765 100644 --- a/MyWebApi/DLL/DAL/LoadDataDAL.cs +++ b/MyWebApi/DLL/DAL/LoadDataDAL.cs @@ -27,10 +27,9 @@ } #endregion - #region銆愪笟鍔¢�昏緫灞傛暟鎹繃搴�,娴佹按绾跨湅鏉垮浘鍨嬫暟鎹�� + #region銆愪笟鍔¢�昏緫灞傛暟鎹繃搴�,娴佹按绾跨湅鏉垮垪琛ㄦ暟鎹�� public static List<LineWork> LineTableData(string LineCode, int startNum, int endNum, out int count) { - List<LineWork> list = new List<LineWork>(); //鎵ц瀛樺偍杩囩▼@lineCodeList // 瀛樺偍杩囩▼鍚嶇О string strProcName = "kb_LineProduct_Table"; @@ -82,6 +81,88 @@ } #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> /// 鍦板浘鏁版嵁鐪嬫澘 -- Gitblit v1.9.1