From 48a57b70a4790e87ff077a5057390c78f313e102 Mon Sep 17 00:00:00 2001 From: tdx Date: Thu, 5 Feb 2026 09:07:43 +0000 Subject: [PATCH] SVN r1117 SVN-Revision: r1117 --- 插件库/Lskj.Business/Impl/MainImpl.cs | 80 ++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/插件库/Lskj.Business/Impl/MainImpl.cs b/插件库/Lskj.Business/Impl/MainImpl.cs index 9a9b7b5..0229bcc 100644 --- a/插件库/Lskj.Business/Impl/MainImpl.cs +++ b/插件库/Lskj.Business/Impl/MainImpl.cs @@ -16,6 +16,8 @@ using Lskj.Model; using System.Net; using System.Collections.Generic; using System.Linq; +using Kdbndp; +using KdbndpTypes; namespace Lskj.Business.Impl { @@ -97,7 +99,7 @@ namespace Lskj.Business.Impl } List list = new List { - new SqlParameter("@ReturnValue",SqlDbType.Int), + new SqlParameter("@ReturnValue",SqlDbType.NVarChar), new SqlParameter("@operatorid",SqlDbType.VarChar), new SqlParameter("@pwd",SqlDbType.VarChar,100), }; @@ -109,9 +111,9 @@ namespace Lskj.Business.Impl cmdParams[0].Direction = ParameterDirection.ReturnValue; cmdParams[1].Value = userId; cmdParams[2].Value = password; - if (cmdParams.Length > 3) + if (cmdParams.Length > 7) { - cmdParams[3].Value = 1; + cmdParams[7].Value = 1; } SqlHelper.ExecuteNonQuery(CommandType.StoredProcedure, "P_Login_pr", cmdParams); return Convert.ToInt32(cmdParams[0].Value); @@ -448,10 +450,8 @@ namespace Lskj.Business.Impl /// public static DataRow GetSystemdllTab(string menuCode) { - string sqlValue = "select * from P_systemdlltab where DllCoid=@coid"; - - DataTable dtTable = SqlHelper.ExecuteDataTable(sqlValue, new SqlParameter[] { new SqlParameter("@coid", menuCode) });//执行sql返回DataTable - + string sqlValue = $"select * from P_systemdlltab where DllCoid = '{menuCode}'"; + DataTable dtTable = SqlHelper.ExecuteDataTable(sqlValue);//执行sql返回DataTable return dtTable.Rows.Count > 0 ? dtTable.Rows[0] : null; } /// @@ -1261,4 +1261,68 @@ namespace Lskj.Business.Impl if (dataRow != null && !string.IsNullOrWhiteSpace(dataRow["MacAddress"] + "")) { List MacAddress = ((dataRow["MacAddress"] + "").Split(',')).ToList(); - \ No newline at end of file + return MacAddress.Contains(ERPInfo.Instance.MacAddress); + } + } + } + } + catch (Exception ex) + { + return false; + } + + return true; + } + + /// + /// 说明:获取模块信息 + /// 创建人:曹屹峰 + /// 创建日期:2025-03-03 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public static DataRow GetModuleInformation(string menuCode) + { + string sqlValue = string.Format("select * from p_formmenuconfigtab where PurviewId='{0}'", menuCode); + + DataTable dtTable = SqlHelper.ExecuteDataTable(sqlValue); + + return dtTable.Rows.Count > 0 ? dtTable.Rows[0] : null; + } + + /// + /// 获取自增长列名 + /// + /// + public static string GetAutogrowcolumn(string tableName) + { + string sqlvalue = $@"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns + WHERE TABLE_NAME = '{0}' AND COLUMNPROPERTY(OBJECT_ID('{tableName}'),COLUMN_NAME,'IsIdentity')= 1;"; + if (SqlHelper.ConnectionType == ConnectionType.DmServer) + { + sqlvalue = $@"select a.NAME from SYS.SYSCOLUMNS a,sysobjects b + where b.id = a.id and b.name = '{tableName}' and a.info2 = 1;"; + } + return BaseImpl.GetResult(sqlvalue) + ""; + } + + /// + /// 获取表格属性 + /// + /// + public static DataTable GetDatabaseProperty(string tableName) + { + string sqlvalue = $@"select COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH from information_schema.columns + where table_name = '{tableName}';"; + if (SqlHelper.ConnectionType == ConnectionType.DmServer) + { + sqlvalue = $@"SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH AS CHARACTER_MAXIMUM_LENGTH + FROM USER_TAB_COLUMNS WHERE TABLE_NAME = '{tableName}';"; + } + return BaseImpl.GetDataTableResult(sqlvalue); + } + + } +} \ No newline at end of file