Commit 638cd977 authored by 罗显健's avatar 罗显健
parents cf1e1b85 68e8c561
......@@ -156,4 +156,16 @@
<UserId>sa</UserId>
<Pwd>sa</Pwd>
</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>
\ No newline at end of file
......@@ -202,11 +202,11 @@
<Compile Include="UI\wEvaluationOfEmployee.Designer.cs">
<DependentUpon>wEvaluationOfEmployee.cs</DependentUpon>
</Compile>
<Compile Include="UI\wFlowShare.cs">
<Compile Include="UI\wFileShare.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\wFlowShare.Designer.cs">
<DependentUpon>wFlowShare.cs</DependentUpon>
<Compile Include="UI\wFileShare.Designer.cs">
<DependentUpon>wFileShare.cs</DependentUpon>
</Compile>
<Compile Include="UI\wImageSearch.cs">
<SubType>Form</SubType>
......@@ -425,8 +425,8 @@
<EmbeddedResource Include="UI\wEvaluationOfEmployee.resx">
<DependentUpon>wEvaluationOfEmployee.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\wFlowShare.resx">
<DependentUpon>wFlowShare.cs</DependentUpon>
<EmbeddedResource Include="UI\wFileShare.resx">
<DependentUpon>wFileShare.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\wImageSearch.resx">
<DependentUpon>wImageSearch.cs</DependentUpon>
......
......@@ -25,7 +25,11 @@ namespace Tools.UI.sys
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"));
//初始化界面
......@@ -49,6 +53,8 @@ namespace Tools.UI.sys
public override void InitData()
{
this._ds = this._db.GetData(this.ModuleTableList, true);
//为优化取数速度虚构dData列,虚构列默认为只读,这里改为可编辑,方便更新操作
this._ds.Tables[0].Columns["dData"].ReadOnly = false;
this.AsyncUI(() => {
this.dgvDetail.DataSource = this._ds.Tables[0].DefaultView;
this.ButtonEnabled(true);
......@@ -116,6 +122,11 @@ namespace Tools.UI.sys
{
var drNow = this._ds.Tables[0].DefaultView[e.RowIndex];
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[]);
Utils.Tip("下载成功!");
}
......
......@@ -38,7 +38,8 @@ namespace Tools.UI
public override void InitData()
{
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
WHERE {strWhere} ORDER BY A.ID DESC";
......
namespace Tools.UI
{
partial class wFlowShare
partial class wFileShare
{
/// <summary>
/// Required designer variable.
......
......@@ -15,9 +15,9 @@ using Tools.MyUtils;
namespace Tools.UI
{
public partial class wFlowShare : wEditBasic
public partial class wFileShare : wEditBasic
{
public wFlowShare()
public wFileShare()
{
InitializeComponent();
}
......@@ -25,7 +25,11 @@ namespace Tools.UI
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"));
//初始化
......@@ -45,6 +49,8 @@ namespace Tools.UI
this.AsyncUI(() => {
this._ds = this._db.GetData(this.ModuleTableList, true);
this.dgvDetail.DataSource = this._ds.Tables[0].DefaultView;
//为优化取数速度虚构dData列,虚构列默认为只读,这里改为可编辑,方便更新操作
this._ds.Tables[0].Columns["dData"].ReadOnly = false;
});
}
......@@ -66,6 +72,11 @@ namespace Tools.UI
{
var drNow = this._ds.Tables[0].DefaultView[e.RowIndex];
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[]);
Utils.Tip("下载成功!");
}
......
......@@ -40,7 +40,7 @@ namespace Tools
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.wTaskBoard), "任务看板", "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