Commit 638cd977 authored by 罗显健's avatar 罗显健
parents cf1e1b85 68e8c561
...@@ -156,4 +156,16 @@ ...@@ -156,4 +156,16 @@
<UserId>sa</UserId> <UserId>sa</UserId>
<Pwd>sa</Pwd> <Pwd>sa</Pwd>
</links> </links>
<links>
<Link>192.168.18.253</Link>
<DbName>JHD_HY</DbName>
<UserId>sa</UserId>
<Pwd>a*1</Pwd>
</links>
<links>
<Link>192.168.18.253</Link>
<DbName>FTT</DbName>
<UserId>sa</UserId>
<Pwd>a*1</Pwd>
</links>
</DocumentElement> </DocumentElement>
\ No newline at end of file
...@@ -202,11 +202,11 @@ ...@@ -202,11 +202,11 @@
<Compile Include="UI\wEvaluationOfEmployee.Designer.cs"> <Compile Include="UI\wEvaluationOfEmployee.Designer.cs">
<DependentUpon>wEvaluationOfEmployee.cs</DependentUpon> <DependentUpon>wEvaluationOfEmployee.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UI\wFlowShare.cs"> <Compile Include="UI\wFileShare.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="UI\wFlowShare.Designer.cs"> <Compile Include="UI\wFileShare.Designer.cs">
<DependentUpon>wFlowShare.cs</DependentUpon> <DependentUpon>wFileShare.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UI\wImageSearch.cs"> <Compile Include="UI\wImageSearch.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
...@@ -425,8 +425,8 @@ ...@@ -425,8 +425,8 @@
<EmbeddedResource Include="UI\wEvaluationOfEmployee.resx"> <EmbeddedResource Include="UI\wEvaluationOfEmployee.resx">
<DependentUpon>wEvaluationOfEmployee.cs</DependentUpon> <DependentUpon>wEvaluationOfEmployee.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UI\wFlowShare.resx"> <EmbeddedResource Include="UI\wFileShare.resx">
<DependentUpon>wFlowShare.cs</DependentUpon> <DependentUpon>wFileShare.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UI\wImageSearch.resx"> <EmbeddedResource Include="UI\wImageSearch.resx">
<DependentUpon>wImageSearch.cs</DependentUpon> <DependentUpon>wImageSearch.cs</DependentUpon>
......
...@@ -25,7 +25,11 @@ namespace Tools.UI.sys ...@@ -25,7 +25,11 @@ namespace Tools.UI.sys
private void wHelpDocument_Load(object sender, EventArgs e) private void wHelpDocument_Load(object sender, EventArgs e)
{ {
//初始化模块表 //初始化模块表
this.ModuleTableList = new List<TQuery> { new TQuery("FTT_HelpDocument", "SELECT * FROM FTT_HelpDocument ") }; this.ModuleTableList = new List<TQuery> {
new TQuery("FTT_HelpDocument",
@"SELECT ID, dName, dSize, CAST(NULL AS IMAGE) AS dData, CreateDate, UpdateDate, CreateUser, UpdateUser
FROM FTT_HelpDocument ")
};
//初始化数据访问对象 //初始化数据访问对象
this.InitDBHelper(Utils.GetDbLinkString204("FTT_Work")); this.InitDBHelper(Utils.GetDbLinkString204("FTT_Work"));
//初始化界面 //初始化界面
...@@ -49,6 +53,8 @@ namespace Tools.UI.sys ...@@ -49,6 +53,8 @@ namespace Tools.UI.sys
public override void InitData() public override void InitData()
{ {
this._ds = this._db.GetData(this.ModuleTableList, true); this._ds = this._db.GetData(this.ModuleTableList, true);
//为优化取数速度虚构dData列,虚构列默认为只读,这里改为可编辑,方便更新操作
this._ds.Tables[0].Columns["dData"].ReadOnly = false;
this.AsyncUI(() => { this.AsyncUI(() => {
this.dgvDetail.DataSource = this._ds.Tables[0].DefaultView; this.dgvDetail.DataSource = this._ds.Tables[0].DefaultView;
this.ButtonEnabled(true); this.ButtonEnabled(true);
...@@ -116,6 +122,11 @@ namespace Tools.UI.sys ...@@ -116,6 +122,11 @@ namespace Tools.UI.sys
{ {
var drNow = this._ds.Tables[0].DefaultView[e.RowIndex]; var drNow = this._ds.Tables[0].DefaultView[e.RowIndex];
var fileName = drNow["dName"].ToString(); var fileName = drNow["dName"].ToString();
if (drNow["dData"] == DBNull.Value)
{
drNow["dData"] = this._db.ExecScalar($"SELECT dData FROM dbo.FTT_HelpDocument WHERE ID = {Convert.ToInt32(drNow["ID"])}");
this._ds.AcceptChanges(); //忽略此更改
}
File.WriteAllBytes($@"{dlg.SelectedPath}\{fileName}", drNow["dData"] as byte[]); File.WriteAllBytes($@"{dlg.SelectedPath}\{fileName}", drNow["dData"] as byte[]);
Utils.Tip("下载成功!"); Utils.Tip("下载成功!");
} }
......
...@@ -38,7 +38,8 @@ namespace Tools.UI ...@@ -38,7 +38,8 @@ namespace Tools.UI
public override void InitData() public override void InitData()
{ {
string sql = $@" string sql = $@"
SELECT a.ID,a.Code,a.Name,a.PrevID,b.Name AS PrevName,a.ModuleName FROM dbo.App_SysBusinessModel a SELECT a.ID,a.Code,a.Name,a.PrevID,b.Name AS PrevName,a.ModuleName
FROM dbo.App_SysBusinessModel a
INNER JOIN dbo.App_SysBusinessModel b ON a.PrevID=b.ID INNER JOIN dbo.App_SysBusinessModel b ON a.PrevID=b.ID
WHERE {strWhere} ORDER BY A.ID DESC"; WHERE {strWhere} ORDER BY A.ID DESC";
......
namespace Tools.UI namespace Tools.UI
{ {
partial class wFlowShare partial class wFileShare
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
......
...@@ -15,9 +15,9 @@ using Tools.MyUtils; ...@@ -15,9 +15,9 @@ using Tools.MyUtils;
namespace Tools.UI namespace Tools.UI
{ {
public partial class wFlowShare : wEditBasic public partial class wFileShare : wEditBasic
{ {
public wFlowShare() public wFileShare()
{ {
InitializeComponent(); InitializeComponent();
} }
...@@ -25,7 +25,11 @@ namespace Tools.UI ...@@ -25,7 +25,11 @@ namespace Tools.UI
private void wFlowShare_Load(object sender, EventArgs e) private void wFlowShare_Load(object sender, EventArgs e)
{ {
//初始化模块表 //初始化模块表
this.ModuleTableList = new List<TQuery> { new TQuery("FTT_Share", "SELECT * FROM FTT_Share") }; this.ModuleTableList = new List<TQuery> {
new TQuery("FTT_Share",
@"SELECT ID, dType, dName, dSize, CAST(NULL AS IMAGE) AS dData, CreateDate, UpdateDate, CreateUser, UpdateUser
FROM dbo.FTT_Share")
};
//初始化数据访问对象 //初始化数据访问对象
this.InitDBHelper(Utils.GetDbLinkString204("FTT_Work")); this.InitDBHelper(Utils.GetDbLinkString204("FTT_Work"));
//初始化 //初始化
...@@ -45,6 +49,8 @@ namespace Tools.UI ...@@ -45,6 +49,8 @@ namespace Tools.UI
this.AsyncUI(() => { this.AsyncUI(() => {
this._ds = this._db.GetData(this.ModuleTableList, true); this._ds = this._db.GetData(this.ModuleTableList, true);
this.dgvDetail.DataSource = this._ds.Tables[0].DefaultView; this.dgvDetail.DataSource = this._ds.Tables[0].DefaultView;
//为优化取数速度虚构dData列,虚构列默认为只读,这里改为可编辑,方便更新操作
this._ds.Tables[0].Columns["dData"].ReadOnly = false;
}); });
} }
...@@ -66,6 +72,11 @@ namespace Tools.UI ...@@ -66,6 +72,11 @@ namespace Tools.UI
{ {
var drNow = this._ds.Tables[0].DefaultView[e.RowIndex]; var drNow = this._ds.Tables[0].DefaultView[e.RowIndex];
var fileName = drNow["dName"].ToString(); var fileName = drNow["dName"].ToString();
if (drNow["dData"] == DBNull.Value)
{
drNow["dData"] = this._db.ExecScalar($"SELECT dData FROM dbo.FTT_Share WHERE ID = {Convert.ToInt32(drNow["ID"])}");
this._ds.AcceptChanges(); //忽略此更改
}
File.WriteAllBytes($@"{dlg.SelectedPath}\{fileName}", drNow["dData"] as byte[]); File.WriteAllBytes($@"{dlg.SelectedPath}\{fileName}", drNow["dData"] as byte[]);
Utils.Tip("下载成功!"); Utils.Tip("下载成功!");
} }
......
...@@ -40,7 +40,7 @@ namespace Tools ...@@ -40,7 +40,7 @@ namespace Tools
return new List<ModuleInfo> return new List<ModuleInfo>
{ {
//------------------------------- //-------------------------------
this.CreateModule(Tools_uni, typeof(UI.wFlowShare), "共享文件", "tr:助力业务沉淀与流程共享"), this.CreateModule(Tools_uni, typeof(UI.wFileShare), "共享文件", "tr:助力业务沉淀与流程共享"),
this.CreateModule(Tools_uni, typeof(UI.wDbLinkMngr), "共享信息", "tr:客户数据库及远程桌面信息"), this.CreateModule(Tools_uni, typeof(UI.wDbLinkMngr), "共享信息", "tr:客户数据库及远程桌面信息"),
this.CreateModule(Tools_uni, typeof(UI.wTaskBoard), "任务看板", "tr:任务看板的简易化工具,免除翻页困扰"), this.CreateModule(Tools_uni, typeof(UI.wTaskBoard), "任务看板", "tr:任务看板的简易化工具,免除翻页困扰"),
this.CreateModule(Tools_uni, typeof(UI.wLoginPwd), "密码解析", "tr:用于登陆密码的解密加密"), this.CreateModule(Tools_uni, typeof(UI.wLoginPwd), "密码解析", "tr:用于登陆密码的解密加密"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment