Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Ftt_Common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Ftt_Common
Commits
adeff414
Commit
adeff414
authored
Nov 06, 2020
by
朱天博
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://192.168.1.181/root/Ftt_Common
parents
a4815c06
5fdfcfc3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
18 deletions
+18
-18
DBHelper.cs
Tools/MyData/DBHelper.cs
+6
-6
SmpDB.cs
Tools/MyData/SmpDB.cs
+6
-6
wAppModelEdit.cs
Tools/UI/wAppModelEdit.cs
+2
-2
wDBTools.cs
Tools/UI/wDBTools.cs
+2
-2
wDbAnlysis.cs
Tools/UI/wDbAnlysis.cs
+1
-1
wSysChecker.cs
Tools/UI/wSysChecker.cs
+1
-1
No files found.
Tools/MyData/DBHelper.cs
View file @
adeff414
...
...
@@ -114,11 +114,11 @@ namespace Tools.MyData
/// <summary>
/// 执行SQL语句:这里的多条语句采用同一事务处理,方便出错时回滚,保证数据统一
/// </summary>
/// <param name="s
trExecSqlList
">带执行的SQL列表</param>
/// <param name="s
qls
">带执行的SQL列表</param>
/// <returns></returns>
public
bool
ExecNonSql
(
List
<
string
>
strExecSqlList
)
public
bool
ExecNonSql
(
params
string
[]
sqls
)
{
return
this
.
_db
.
ExecNonSql
(
this
.
_link
,
s
trExecSqlList
);
return
this
.
_db
.
ExecNonSql
(
this
.
_link
,
s
qls
);
}
/// <summary>
/// 是否存在
...
...
@@ -205,11 +205,11 @@ namespace Tools.MyData
/// <summary>
/// SQL批量执行(异步)
/// </summary>
/// <param name="s
trExecSqlList
"></param>
/// <param name="s
qls
"></param>
/// <returns></returns>
public
Task
<
bool
>
ExecNonSqlAsync
(
List
<
string
>
strExecSqlList
)
public
Task
<
bool
>
ExecNonSqlAsync
(
params
string
[]
sqls
)
{
return
Task
.
Run
(()
=>
ExecNonSql
(
s
trExecSqlList
));
return
Task
.
Run
(()
=>
ExecNonSql
(
s
qls
));
}
/// <summary>
/// 是否存在(异步)
...
...
Tools/MyData/SmpDB.cs
View file @
adeff414
...
...
@@ -351,9 +351,9 @@ namespace Tools.MyData
/// 执行SQL语句:这里的多条语句采用同一事务处理,方便出错时回滚,保证数据统一
/// </summary>
/// <param name="strLink">数据库连接</param>
/// <param name="s
trExecSqlList
">带执行的SQL列表</param>
/// <param name="s
qls
">带执行的SQL列表</param>
/// <returns></returns>
public
bool
ExecNonSql
(
string
strLink
,
List
<
string
>
strExecSqlList
)
public
bool
ExecNonSql
(
string
strLink
,
params
string
[]
sqls
)
{
SqlConnection
conn
=
null
;
SqlCommand
cmd
=
null
;
...
...
@@ -370,7 +370,7 @@ namespace Tools.MyData
cmd
.
Transaction
=
tran
;
//绑定事务
//批量处理命令
foreach
(
string
cmdText
in
s
trExecSqlList
)
foreach
(
string
cmdText
in
s
qls
)
{
cmd
.
CommandText
=
cmdText
;
cmd
.
CommandType
=
CommandType
.
Text
;
...
...
@@ -532,11 +532,11 @@ namespace Tools.MyData
/// SQL批量执行(异步)
/// </summary>
/// <param name="strLink"></param>
/// <param name="s
trExecSqlList
"></param>
/// <param name="s
qls
"></param>
/// <returns></returns>
public
Task
<
bool
>
ExecNonSqlAsync
(
string
strLink
,
List
<
string
>
strExecSqlList
)
public
Task
<
bool
>
ExecNonSqlAsync
(
string
strLink
,
params
string
[]
sqls
)
{
return
Task
.
Run
(()
=>
ExecNonSql
(
strLink
,
s
trExecSqlList
));
return
Task
.
Run
(()
=>
ExecNonSql
(
strLink
,
s
qls
));
}
/// <summary>
/// 是否存在(异步)
...
...
Tools/UI/wAppModelEdit.cs
View file @
adeff414
...
...
@@ -100,12 +100,12 @@ namespace Tools.UI
if
(
_model
==
null
)
//新增
{
model
.
ID
=
txtID
.
Text
;
this
.
_db
.
ExecNonSql
(
new
List
<
string
>()
{
AppModel
.
GetSql
(
model
,
1
)
}
);
this
.
_db
.
ExecNonSql
(
AppModel
.
GetSql
(
model
,
1
)
);
}
else
//修改
{
model
.
ID
=
_model
.
ID
;
this
.
_db
.
ExecNonSql
(
new
List
<
string
>()
{
AppModel
.
GetSql
(
model
,
2
)
}
);
this
.
_db
.
ExecNonSql
(
AppModel
.
GetSql
(
model
,
2
)
);
}
this
.
Close
();
...
...
Tools/UI/wDBTools.cs
View file @
adeff414
...
...
@@ -228,7 +228,7 @@ namespace Tools.UI
fs
.
Write
(
bytes
,
0
,
bytes
.
Length
);
}
//执行SQL
this
.
_db
.
ExecNonSql
(
new
List
<
string
>
{
sql
}
);
this
.
_db
.
ExecNonSql
(
sql
);
//Utils.Tip("Sql生成并执行成功!");
Utils
.
OpenFileWithNotepad
(
sqlFileName
);
}
...
...
@@ -462,7 +462,7 @@ namespace Tools.UI
}
}
//执行SQL语句
this
.
_db
.
ExecNonSql
(
sqlist
);
this
.
_db
.
ExecNonSql
(
sqlist
.
ToArray
()
);
}
/// <summary>
/// 初始化默认路径
...
...
Tools/UI/wDbAnlysis.cs
View file @
adeff414
...
...
@@ -64,7 +64,7 @@ namespace Tools.UI
SELECT COUNT(*) FROM
{
objName
}
END"
;
stopwatch
.
Restart
();
this
.
_db
.
ExecNonSql
(
new
List
<
string
>
{
anlysisSql
}
);
this
.
_db
.
ExecNonSql
(
anlysisSql
);
stopwatch
.
Stop
();
result
.
Add
(
$"
{
stopwatch
.
ElapsedMilliseconds
/
1000F
}
秒\t
{
objName
}
"
);
}
...
...
Tools/UI/wSysChecker.cs
View file @
adeff414
...
...
@@ -166,7 +166,7 @@ namespace Tools.UI
{
using
(
SmpDB
tmpdb
=
new
SmpDB
())
{
tmpdb
.
ExecNonSql
(
localLink
,
sqlist
);
tmpdb
.
ExecNonSql
(
localLink
,
sqlist
.
ToArray
()
);
}
}
catch
(
Exception
ex
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment