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
cb4c901d
Commit
cb4c901d
authored
Nov 26, 2021
by
段廷瑞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、任务看板:增加双击查看详情;行颜色渲染优化
parent
62ddd31c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
3 deletions
+113
-3
Tools.exe.config
AppHome/Tools.exe.config
+1
-1
TaskDetail.html
AppHome/test/TaskDetail.html
+9
-0
DBHelper.cs
Tools/MyData/DBHelper.cs
+9
-0
SmpDB.cs
Tools/MyData/SmpDB.cs
+40
-0
wTaskBoard.cs
Tools/UI/wTaskBoard.cs
+54
-2
No files found.
AppHome/Tools.exe.config
View file @
cb4c901d
...
...
@@ -3,7 +3,7 @@
<
appSettings
>
<
add
key
=
"LoginInfo"
value
=
"wwF/xpBzWek="
/>
<
add
key
=
"LoginVerify"
value
=
"v86f5Q3Xa7U="
/>
<
add
key
=
"UpdateTime"
value
=
"2021-11-2
0 17:58:10.043
"
/>
<
add
key
=
"UpdateTime"
value
=
"2021-11-2
6 14:21:49.650
"
/>
</
appSettings
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.8"
/>
...
...
AppHome/test/TaskDetail.html
0 → 100644
View file @
cb4c901d
<!DOCTYPE html>
<html
lang=
"en"
xmlns=
"http://www.w3.org/1999/xhtml"
>
<head>
<meta
charset =
"utf-8"
/>
</head>
<body>
<p>
[describle]
</p>
</body>
</html>
\ No newline at end of file
Tools/MyData/DBHelper.cs
View file @
cb4c901d
...
...
@@ -130,6 +130,15 @@ namespace Tools.MyData
{
return
this
.
_db
.
IsExist
(
this
.
_link
,
strSql
);
}
/// <summary>
/// 执行并返回首个对象
/// </summary>
/// <param name="strSql"></param>
/// <returns></returns>
public
object
ExecScalar
(
string
strSql
)
{
return
this
.
_db
.
ExecScalar
(
this
.
_link
,
strSql
);
}
#
region
async
methods
...
...
Tools/MyData/SmpDB.cs
View file @
cb4c901d
...
...
@@ -432,6 +432,46 @@ namespace Tools.MyData
return
iCount
>
0
;
}
/// <summary>
/// 执行SQL,并返回首个对象
/// </summary>
/// <param name="strLink"></param>
/// <param name="strSql"></param>
/// <returns></returns>
public
object
ExecScalar
(
string
strLink
,
string
strSql
)
{
object
result
=
null
;
SqlConnection
conn
=
null
;
SqlTransaction
tran
=
null
;
try
{
conn
=
new
SqlConnection
(
strLink
);
conn
.
Open
();
tran
=
conn
.
BeginTransaction
();
//开始事务
var
cmd
=
new
SqlCommand
();
cmd
.
Connection
=
conn
;
//绑定连接
cmd
.
Transaction
=
tran
;
//绑定事务
cmd
.
CommandText
=
strSql
;
cmd
.
CommandType
=
CommandType
.
Text
;
result
=
cmd
.
ExecuteScalar
();
//提交事务
tran
.
Commit
();
}
catch
(
Exception
ex
)
{
if
(
tran
!=
null
)
tran
.
Rollback
();
throw
(
new
Exception
(
"执行SQL出错:\r\n"
+
ex
.
Message
));
}
finally
{
if
(
conn
.
State
==
ConnectionState
.
Open
)
conn
.
Close
();
}
return
result
;
}
#
region
async
methods
...
...
Tools/UI/wTaskBoard.cs
View file @
cb4c901d
...
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.ComponentModel
;
using
System.Data
;
using
System.Drawing
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
...
...
@@ -10,6 +11,7 @@ using System.Windows.Forms;
//
using
Tools.MyCommon
;
using
Tools.MyData
;
using
Tools.MyUtils
;
namespace
Tools.UI
{
...
...
@@ -18,6 +20,10 @@ namespace Tools.UI
DBHelper
_db
=
null
;
DataTable
_dt
=
null
;
wBasic
frmView
=
null
;
WebBrowser
_browser
=
null
;
string
_html
=
""
;
string
ProjectName
=>
this
.
cbProjectName
.
Text
;
string
InChargeUser
=>
this
.
cbInChargeUser
.
Text
;
string
TaskState
=>
this
.
cbTaskState
.
Text
;
...
...
@@ -41,7 +47,16 @@ namespace Tools.UI
}
private
void
wTaskBoard_Shown
(
object
sender
,
EventArgs
e
)
{
//初始化单元格背景
this
.
SetGridForeColor
();
//双击查看任务明细初始化
this
.
_html
=
File
.
ReadAllText
(
$@"
{
Utils
.
TestPath
}
\TaskDetail.html"
);
this
.
frmView
=
new
wBasic
()
{
BackColor
=
Color
.
White
,
Size
=
new
Size
(
600
,
400
)
};
this
.
_browser
=
new
WebBrowser
()
{
Parent
=
this
.
frmView
,
Dock
=
DockStyle
.
Fill
};
this
.
frmView
.
FormClosing
+=
FrmView_FormClosing
;
//表格事件
this
.
dataGridView1
.
Sorted
+=
DataGridView1_Sorted
;
this
.
dataGridView1
.
DoubleClick
+=
DataGridView1_DoubleClick
;
}
/// <summary>
...
...
@@ -125,7 +140,44 @@ namespace Tools.UI
//附加过滤条件
this
.
cb_SelectedIndexChanged
(
null
,
null
);
}
//表格事件:排序后,重新渲染表格颜色
private
void
DataGridView1_Sorted
(
object
sender
,
EventArgs
e
)
{
this
.
SetGridForeColor
();
}
//表格事件:双击查看任务详情
private
void
DataGridView1_DoubleClick
(
object
sender
,
EventArgs
e
)
{
if
(
this
.
dataGridView1
.
CurrentRow
==
null
)
return
;
var
index
=
this
.
dataGridView1
.
CurrentRow
.
Index
;
if
(
index
<
0
)
return
;
//显示详情
this
.
ShowDetail
(
this
.
_dt
.
DefaultView
[
index
].
Row
);
}
//拦截窗口关闭事件
private
void
FrmView_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
{
this
.
frmView
.
Visible
=
false
;
e
.
Cancel
=
true
;
}
/// <summary>
/// 显示任务详情
/// </summary>
/// <param name="text"></param>
private
void
ShowDetail
(
DataRow
drNow
)
{
if
(
drNow
==
null
)
return
;
var
taskID
=
(
int
)
drNow
[
"TaskID"
];
var
content
=
this
.
_db
.
ExecScalar
(
$"select Describe from PM_Task where ID =
{
taskID
}
"
);
if
(
content
==
null
)
return
;
this
.
_browser
.
DocumentText
=
this
.
_html
.
Replace
(
"<p>[describle]</p>"
,
content
.
ToString
());
this
.
frmView
.
Text
=
$"[
{
drNow
[
"项目名称"
]}
]
{
drNow
[
"需求内容"
]}
"
;
this
.
frmView
.
Show
();
}
}
}
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