Commit 7de75e4d authored by tr's avatar tr

1、员工管理:数据初始化改为异步加载

parent e610f2d2
......@@ -63,7 +63,7 @@ namespace Tools.MyUtils
/// <returns></returns>
private static FtpClient GetFtpClient()
{
return new FtpClient(SegConfig.UploadFtpUrl, SegConfig.UploadFtpUserID, SegConfig.UploadFtpPassword);
return new FtpClient(SegPictureConfig.UploadFtpUrl, SegPictureConfig.UploadFtpUserID, SegPictureConfig.UploadFtpPassword);
}
/// <summary>
/// 获取HTTP客户端实例
......@@ -74,7 +74,7 @@ namespace Tools.MyUtils
/// <returns></returns>
private static HttpClient GetHttpClient(string md5, bool enableCachedDisk, Dictionary<string, object> paras)
{
return new HttpClient(SegConfig.DownloadHttpBaseUrl, md5, enableCachedDisk, paras);
return new HttpClient(SegPictureConfig.DownloadHttpBaseUrl, md5, enableCachedDisk, paras);
}
#endregion
......@@ -82,7 +82,7 @@ namespace Tools.MyUtils
/// <summary>
/// 图片分离配置
/// </summary>
public class SegConfig
public class SegPictureConfig
{
/// <summary>
/// 下载的Http基础路径
......
......@@ -24,7 +24,7 @@ namespace Tools.UI
//事件:窗体加载
private void wUser_Load(object sender, EventArgs e)
{
this.InitData();
Task.Run(() => this.InitData());
this.InitUI();
}
//事件:添加
......@@ -54,13 +54,17 @@ namespace Tools.UI
public override void InitData()
{
var link = Utils.GetDbLinkString204("FTT_Work");
this.InitDBHelper(link);
this.ModuleTableList = new List<TQuery> { new TQuery("AC_User", "SELECT * FROM dbo.AC_User") };
this._ds = this._db.GetData(this.ModuleTableList, true);
//图片分离兼容处理
SegConfig.Init(link);
Utils.FetchImage(this._ds);
this.AsyncUI(() => {
var link = Utils.GetDbLinkString204("FTT_Work");
this.InitDBHelper(link);
this.ModuleTableList = new List<TQuery> { new TQuery("AC_User", "SELECT * FROM dbo.AC_User") };
this._ds = this._db.GetData(this.ModuleTableList, true);
//图片分离兼容处理
SegPictureConfig.Init(link);
Utils.FetchImage(this._ds);
//绑定数据源
this.dgvDetail.DataSource = this._ds.Tables[0].DefaultView;
});
}
public override void InitUI()
{
......@@ -71,8 +75,6 @@ namespace Tools.UI
//事件
this.dgvDetail.CellFormatting += DgvDetail_CellFormatting;
this.dgvDetail.DataError += DgvDetail_DataError;
//绑定数据源
this.dgvDetail.DataSource = this._ds.Tables[0].DefaultView;
}
//事件:单元格格式化
......
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