9 Commits

Author SHA1 Message Date
cyf dd58f12374 feat: 更新业务及控件功能 2026-08-21 17:21:18 +08:00
tdx d3587a16f1 chore(browser): sync current working implementation
Rollback tag: pre-current-browser-sync-20260818
2026-08-18 14:30:23 +08:00
tdx 6b78bbbf04 fix: 恢复 ModuleGridEx 组件容器管理 2026-08-15 22:37:07 +08:00
cyf 57dedb5e9d feat: 新增时间输入和Alt按钮快捷键 2026-08-15 22:26:11 +08:00
tdx a65dfab897 fix: synchronize module data cache cleanup 2026-08-15 18:39:26 +08:00
tdx d098dde830 chore(report): 清理临时资源诊断代码 2026-08-15 16:37:10 +08:00
tdx ef13d46fa2 Merge branch 'main' of http://192.168.0.7:4133/cyf/lserp_cs_6.0 2026-08-15 16:35:25 +08:00
tdx fc5faab65d fix(control): 修复金额单元格关闭阶段异常 2026-08-15 16:00:10 +08:00
cyf b091eca540 feat: 更新控件及表格功能 2026-08-15 14:42:21 +08:00
63 changed files with 1496 additions and 1134 deletions
@@ -107,7 +107,7 @@
this.btnCancel.Name = "btnCancel"; this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(80, 28); this.btnCancel.Size = new System.Drawing.Size(80, 28);
this.btnCancel.TabIndex = 4; this.btnCancel.TabIndex = 4;
this.btnCancel.Text = "退出(&C)"; this.btnCancel.Text = "退出(C)";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
// //
// btnFileManger // btnFileManger
@@ -175,7 +175,7 @@
this.btnSave.Name = "btnSave"; this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(80, 28); this.btnSave.Size = new System.Drawing.Size(80, 28);
this.btnSave.TabIndex = 11; this.btnSave.TabIndex = 11;
this.btnSave.Text = "保存(&S)"; this.btnSave.Text = "保存(S)";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click); this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
// //
// dpb_Tools // dpb_Tools
@@ -458,7 +458,7 @@
this.btnClose.Name = "btnClose"; this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(58, 23); this.btnClose.Size = new System.Drawing.Size(58, 23);
this.btnClose.TabIndex = 12; this.btnClose.TabIndex = 12;
this.btnClose.Text = "关闭(&Q)"; this.btnClose.Text = "关闭(Q)";
this.btnClose.Click += new System.EventHandler(this.btnClose_Click); this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
// //
// labeltxt_managerAudit // labeltxt_managerAudit
@@ -39,6 +39,9 @@ namespace Lskj.BaseAccraditation
{ {
public partial class FrmBaseAccraditation : BaseForm public partial class FrmBaseAccraditation : BaseForm
{ {
private readonly AltButtonShortcutManager mAltButtonShortcuts =
new AltButtonShortcutManager();
#region #region
/// <summary> /// <summary>
/// 审批模型 /// 审批模型
@@ -190,6 +193,23 @@ namespace Lskj.BaseAccraditation
public FrmBaseAccraditation() public FrmBaseAccraditation()
{ {
InitializeComponent(); InitializeComponent();
InitializeAltButtonShortcuts();
}
private void InitializeAltButtonShortcuts()
{
mAltButtonShortcuts.Register(btnCancel, Keys.C);
mAltButtonShortcuts.Register(btnSave, Keys.S);
mAltButtonShortcuts.Register(btnAudit, Keys.Y);
mAltButtonShortcuts.Register(btnClose, Keys.Q);
mAltButtonShortcuts.Register(btnReturnd, Keys.N);
}
protected override bool ProcessCmdKey(
ref System.Windows.Forms.Message msg, Keys keyData)
{
return mAltButtonShortcuts.ProcessKey(keyData) ||
base.ProcessCmdKey(ref msg, keyData);
} }
private void ReleaseResourcesForDispose() private void ReleaseResourcesForDispose()
@@ -219,7 +239,7 @@ namespace Lskj.BaseAccraditation
} }
if (SysModel != null && SysModel.DataCaches != null) if (SysModel != null && SysModel.DataCaches != null)
{ {
SysModel.DataCaches.Remove(this); SysModel.DataCaches.RemoveCache(this);
} }
} }
catch catch
@@ -1480,7 +1500,7 @@ namespace Lskj.BaseAccraditation
{ {
this.btnAudit.Enabled = true; this.btnAudit.Enabled = true;
this.btnClose.Visible = this.btnRemindAccradit.Visible = this.btnRemindBack.Visible = this.btnSave.Visible = this.btnReturnd.Visible = false; this.btnClose.Visible = this.btnRemindAccradit.Visible = this.btnRemindBack.Visible = this.btnSave.Visible = this.btnReturnd.Visible = false;
this.btnAudit.Text = "确认(&Y)"; this.btnAudit.Text = "确认(Y)";
this.label_auditPerson.Text = "确认意见"; this.label_auditPerson.Text = "确认意见";
this.labeltxt_managerAudit.Text = "会签人"; this.labeltxt_managerAudit.Text = "会签人";
this.txt_remark.Text = "确认"; this.txt_remark.Text = "确认";
+2 -1
View File
@@ -373,7 +373,8 @@ namespace Lskj.Business.Impl
.Replace("#", "%23") .Replace("#", "%23")
.Replace("%2f", "/") .Replace("%2f", "/")
.Replace("", "%ef%bc%88") .Replace("", "%ef%bc%88")
.Replace("", "%ef%bc%89"); .Replace("", "%ef%bc%89")
.Replace(" ", "%20");
// 完全参数化 SQL,彻底杜绝 SQL 注入! // 完全参数化 SQL,彻底杜绝 SQL 注入!
sqlValue = @"SELECT * FROM P_fm_FileTab sqlValue = @"SELECT * FROM P_fm_FileTab
+9
View File
@@ -100,12 +100,15 @@ namespace Lskj.Business.Impl
/// <param name="colName">Name of the col.</param> /// <param name="colName">Name of the col.</param>
/// <returns><c>true</c> if [has contain column]; otherwise, <c>false</c>.</returns> /// <returns><c>true</c> if [has contain column]; otherwise, <c>false</c>.</returns>
public static bool HasExistsColumn(string tableName, string colName, string colType) public static bool HasExistsColumn(string tableName, string colName, string colType)
{
return InitialParamCache.GetColumnExists(tableName, colName, colType, delegate
{ {
if (!HasExistsColumn(tableName, colName)) if (!HasExistsColumn(tableName, colName))
{ {
return ExecSqlValue(string.Format("ALTER TABLE {0} ADD {1} {2}", tableName, colName, colType)) > 0; return ExecSqlValue(string.Format("ALTER TABLE {0} ADD {1} {2}", tableName, colName, colType)) > 0;
} }
return true; return true;
});
} }
/// <summary> /// <summary>
/// <para>说明:是否存在xxx表</para> /// <para>说明:是否存在xxx表</para>
@@ -119,6 +122,8 @@ namespace Lskj.Business.Impl
/// <param name="tableName">Name of the table.</param> /// <param name="tableName">Name of the table.</param>
/// <returns><c>true</c> if [has exists table] [the specified table name]; otherwise, <c>false</c>.</returns> /// <returns><c>true</c> if [has exists table] [the specified table name]; otherwise, <c>false</c>.</returns>
public static bool HasExistsTable(string tableName) public static bool HasExistsTable(string tableName)
{
return InitialParamCache.GetTableExists(tableName, delegate
{ {
try try
{ {
@@ -129,6 +134,7 @@ namespace Lskj.Business.Impl
{ {
} }
return false; return false;
});
} }
/// <summary> /// <summary>
@@ -972,9 +978,12 @@ namespace Lskj.Business.Impl
/// <param name="tableName">Name of the table.</param> /// <param name="tableName">Name of the table.</param>
/// <returns>DataTable.</returns> /// <returns>DataTable.</returns>
public static DataTable GetTableColumns(string tableName) public static DataTable GetTableColumns(string tableName)
{
return InitialParamCache.GetTableColumns(tableName, delegate
{ {
string sqlValue = string.Format("select * from {0} where 1<>1", tableName); string sqlValue = string.Format("select * from {0} where 1<>1", tableName);
return SqlHelper.ExecuteDataTable(sqlValue); return SqlHelper.ExecuteDataTable(sqlValue);
});
} }
/// <summary> /// <summary>
/// <para>说明:执行SQL语句返回结果集</para> /// <para>说明:执行SQL语句返回结果集</para>
+3 -32
View File
@@ -926,15 +926,7 @@ namespace Lskj.Business.Impl
{ {
string field = string.Empty; string field = string.Empty;
DataTable dataTable; DataTable dataTable = GetTableColumns("p_systembillsourcecond");
try
{
dataTable = InitialParamCache.GetTableColumns("p_systembillsourcecond", delegate { return GetTableColumns("p_systembillsourcecond"); });
}
catch (Exception)
{
dataTable = GetTableColumns("p_systembillsourcecond");
}
if (dataTable.Columns.Contains("FontSize")) if (dataTable.Columns.Contains("FontSize"))
{ {
@@ -1150,16 +1142,7 @@ namespace Lskj.Business.Impl
switch (type) switch (type)
{ {
case ModuleType.MrpClickBtn: case ModuleType.MrpClickBtn:
bool isMrpClickBtnExists; if (BaseImpl.HasExistsColumn("P_systempopupmenu", "isMrpClickBtn", "int"))
try
{
isMrpClickBtnExists = InitialParamCache.GetColumnExists("P_systempopupmenu", "isMrpClickBtn", "int", delegate { return BaseImpl.HasExistsColumn("P_systempopupmenu", "isMrpClickBtn", "int"); });
}
catch (Exception)
{
isMrpClickBtnExists = BaseImpl.HasExistsColumn("P_systempopupmenu", "isMrpClickBtn", "int");
}
if (isMrpClickBtnExists)
{ {
where = " and isnull(isMrpClickBtn,0)=1 and visible1=0 "; where = " and isnull(isMrpClickBtn,0)=1 and visible1=0 ";
} }
@@ -1581,19 +1564,7 @@ namespace Lskj.Business.Impl
//保存条件表 //保存条件表
public static DataTable GetClientCond(string MenuCode) public static DataTable GetClientCond(string MenuCode)
{ {
const string tableName = "P_SystemClientCondTab"; if (BaseImpl.HasExistsTable("P_SystemClientCondTab"))
bool tableExists;
try
{
tableExists = InitialParamCache.GetTableExists(tableName, delegate { return BaseImpl.HasExistsTable(tableName); });
}
catch (Exception)
{
// 缓存未能正常读取或记录时,重新查询,避免影响原有功能。
tableExists = BaseImpl.HasExistsTable(tableName);
}
if (tableExists)
{ {
string sqlValue = string.Format(@"select * from P_SystemClientCondTab where tab='{0}' and disableflag=0 order by orderid ", MenuCode); string sqlValue = string.Format(@"select * from P_SystemClientCondTab where tab='{0}' and disableflag=0 order by orderid ", MenuCode);
return GetDataTableResult(sqlValue); return GetDataTableResult(sqlValue);
@@ -340,6 +340,7 @@ namespace Lskj.Business
ResourceDynamic.PubBrower = System.Environment.OSVersion.Version.Major == 5 && (System.Environment.OSVersion.Version.Minor == 1 || System.Environment.OSVersion.Version.Minor == 2) ? "Lskj.PubBrowerXp.dll" : "Lskj.PubBrower2.dll"; ResourceDynamic.PubBrower = System.Environment.OSVersion.Version.Major == 5 && (System.Environment.OSVersion.Version.Minor == 1 || System.Environment.OSVersion.Version.Minor == 2) ? "Lskj.PubBrowerXp.dll" : "Lskj.PubBrower2.dll";
} }
Instance.IsSpecialAuditSave = item.Table.Columns.Contains("IsSpecialAuditSave") && !string.IsNullOrEmpty(item["IsSpecialAuditSave"] + "") ? "1".Equals(item["IsSpecialAuditSave"] + "") : false; Instance.IsSpecialAuditSave = item.Table.Columns.Contains("IsSpecialAuditSave") && !string.IsNullOrEmpty(item["IsSpecialAuditSave"] + "") ? "1".Equals(item["IsSpecialAuditSave"] + "") : false;
Instance.SuppressImportSuccessTip = item.Table.Columns.Contains("SuppressImportSuccessTip") && !string.IsNullOrEmpty(item["SuppressImportSuccessTip"] + "") ? "1".Equals(item["SuppressImportSuccessTip"] + "") : false;
} }
@@ -1179,5 +1180,9 @@ namespace Lskj.Business
/// P_MessageToolLinkDllTab表中cardId=-99为通用模块(右侧快捷通道通用模块) 2023-12-4 徐成说的cardId=-99的配置 /// P_MessageToolLinkDllTab表中cardId=-99为通用模块(右侧快捷通道通用模块) 2023-12-4 徐成说的cardId=-99的配置
/// </summary> /// </summary>
//public DataTable DefaultPermissionTable; //public DataTable DefaultPermissionTable;
/// <summary>
/// 导入成功不会提示,直接关闭导入框(失败时还是会提示)
/// </summary>
public bool SuppressImportSuccessTip;
} }
} }
+8 -8
View File
@@ -175,7 +175,7 @@
this.btnClose.Name = "btnClose"; this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(75, 26); this.btnClose.Size = new System.Drawing.Size(75, 26);
this.btnClose.TabIndex = 22; this.btnClose.TabIndex = 22;
this.btnClose.Text = "关闭(&Q)"; this.btnClose.Text = "关闭(Q)";
// //
// btnBack // btnBack
// //
@@ -187,7 +187,7 @@
this.btnBack.Name = "btnBack"; this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(75, 26); this.btnBack.Size = new System.Drawing.Size(75, 26);
this.btnBack.TabIndex = 21; this.btnBack.TabIndex = 21;
this.btnBack.Text = "返退(&N)"; this.btnBack.Text = "返退(N)";
this.btnBack.Click += new System.EventHandler(this.btnReturn_Click); this.btnBack.Click += new System.EventHandler(this.btnReturn_Click);
// //
// btnSave // btnSave
@@ -200,7 +200,7 @@
this.btnSave.Name = "btnSave"; this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(75, 26); this.btnSave.Size = new System.Drawing.Size(75, 26);
this.btnSave.TabIndex = 25; this.btnSave.TabIndex = 25;
this.btnSave.Text = "保存(&S)"; this.btnSave.Text = "保存(S)";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click); this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
// //
// btnAccradit // btnAccradit
@@ -213,7 +213,7 @@
this.btnAccradit.Name = "btnAccradit"; this.btnAccradit.Name = "btnAccradit";
this.btnAccradit.Size = new System.Drawing.Size(75, 26); this.btnAccradit.Size = new System.Drawing.Size(75, 26);
this.btnAccradit.TabIndex = 20; this.btnAccradit.TabIndex = 20;
this.btnAccradit.Text = "审核(&Y)"; this.btnAccradit.Text = "审核(Y)";
this.btnAccradit.Click += new System.EventHandler(this.btnAccradit_Click); this.btnAccradit.Click += new System.EventHandler(this.btnAccradit_Click);
// //
// btnPrint // btnPrint
@@ -256,7 +256,7 @@
this.btnSpare.Name = "btnSpare"; this.btnSpare.Name = "btnSpare";
this.btnSpare.Size = new System.Drawing.Size(75, 26); this.btnSpare.Size = new System.Drawing.Size(75, 26);
this.btnSpare.TabIndex = 27; this.btnSpare.TabIndex = 27;
this.btnSpare.Text = "分单(&P)"; this.btnSpare.Text = "分单(P)";
this.btnSpare.Click += new System.EventHandler(this.btnSpare_Click); this.btnSpare.Click += new System.EventHandler(this.btnSpare_Click);
// //
// pcTool // pcTool
@@ -381,7 +381,7 @@
this.btnReflash.Name = "btnReflash"; this.btnReflash.Name = "btnReflash";
this.btnReflash.Size = new System.Drawing.Size(75, 26); this.btnReflash.Size = new System.Drawing.Size(75, 26);
this.btnReflash.TabIndex = 27; this.btnReflash.TabIndex = 27;
this.btnReflash.Text = "刷新(&R)"; this.btnReflash.Text = "刷新(R)";
this.btnReflash.Click += new System.EventHandler(this.btnReflash_Click); this.btnReflash.Click += new System.EventHandler(this.btnReflash_Click);
// //
// panelControl1 // panelControl1
@@ -523,7 +523,7 @@
this.btnSearch.Name = "btnSearch"; this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(72, 26); this.btnSearch.Size = new System.Drawing.Size(72, 26);
this.btnSearch.TabIndex = 6; this.btnSearch.TabIndex = 6;
this.btnSearch.Text = "搜索(&Q)"; this.btnSearch.Text = "搜索(Q)";
this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click); this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
// //
// labeldate_end // labeldate_end
@@ -571,7 +571,7 @@
this.btnBackTop.Name = "btnBackTop"; this.btnBackTop.Name = "btnBackTop";
this.btnBackTop.Size = new System.Drawing.Size(72, 26); this.btnBackTop.Size = new System.Drawing.Size(72, 26);
this.btnBackTop.TabIndex = 8; this.btnBackTop.TabIndex = 8;
this.btnBackTop.Text = "返审(&W)"; this.btnBackTop.Text = "返审(W)";
this.btnBackTop.Click += new System.EventHandler(this.btnBack_Click); this.btnBackTop.Click += new System.EventHandler(this.btnBack_Click);
// //
// pcBillDetail // pcBillDetail
+25 -1
View File
@@ -29,11 +29,35 @@ namespace Lskj.Control
{ {
public partial class AuditPanel2 : UserControl public partial class AuditPanel2 : UserControl
{ {
private readonly AltButtonShortcutManager mAltButtonShortcuts =
new AltButtonShortcutManager();
public AuditPanel2() public AuditPanel2()
{ {
InitializeComponent(); InitializeComponent();
InitializeAltButtonShortcuts();
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true); SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);
} }
private void InitializeAltButtonShortcuts()
{
mAltButtonShortcuts.Register(btnClose, Keys.Q);
mAltButtonShortcuts.Register(btnBack, Keys.N);
mAltButtonShortcuts.Register(btnSave, Keys.S);
mAltButtonShortcuts.Register(btnAccradit, Keys.Y);
mAltButtonShortcuts.Register(btnSpare, Keys.P);
mAltButtonShortcuts.Register(btnReflash, Keys.R);
mAltButtonShortcuts.Register(btnSearch, Keys.Q);
mAltButtonShortcuts.Register(btnBackTop, Keys.W);
}
protected override bool ProcessCmdKey(
ref System.Windows.Forms.Message msg, Keys keyData)
{
return mAltButtonShortcuts.ProcessKey(keyData) ||
base.ProcessCmdKey(ref msg, keyData);
}
#region #region
public string modelkeyName = ""; public string modelkeyName = "";
/// <summary> /// <summary>
@@ -1601,7 +1625,7 @@ namespace Lskj.Control
this.btnClose.Enabled = this.btnSave.Enabled = this.btnAccradit.Enabled = this.btnBack.Enabled = this.btnSpare.Enabled = false; this.btnClose.Enabled = this.btnSave.Enabled = this.btnAccradit.Enabled = this.btnBack.Enabled = this.btnSpare.Enabled = false;
this.btnSave.Visible = this.btnClose.Visible = this.btnBack.Visible = this.pcTool.Visible = true; this.btnSave.Visible = this.btnClose.Visible = this.btnBack.Visible = this.pcTool.Visible = true;
this.btnAccradit.Text = "确认(&Y)"; this.btnAccradit.Text = "确认(Y)";
return; return;
} }
+210 -210
View File
@@ -32,22 +32,6 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.tabMain = new DevExpress.XtraTab.XtraTabControl();
this.tabpage_finish = new DevExpress.XtraTab.XtraTabPage();
this.gridFinish = new Lskj.Control.GridControlEx();
this.splitBelow = new DevExpress.XtraEditors.SplitContainerControl();
this.gridFlow = new Lskj.Control.GridControlEx();
this.gridDetail = new Lskj.Control.GridControlEx();
this.pl_top = new DevExpress.XtraEditors.PanelControl();
this.pl_top_searchCond = new DevExpress.XtraEditors.PanelControl();
this.labeldate_start = new Lskj.Control.LabelCheckDateEdit();
this.labelcheck_finalAuditor = new Lskj.Control.LabelCheckAutoTextEdit();
this.labeltxt_dataFlag = new Lskj.Control.LabelTextEdit();
this.btnSearch = new DevExpress.XtraEditors.SimpleButton();
this.labeldate_end = new Lskj.Control.LabelCheckDateEdit();
this.pl_top_right = new DevExpress.XtraEditors.PanelControl();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
this.btnBack = new DevExpress.XtraEditors.SimpleButton();
this.label_tips = new DevExpress.XtraEditors.LabelControl(); this.label_tips = new DevExpress.XtraEditors.LabelControl();
this.label_date = new DevExpress.XtraEditors.LabelControl(); this.label_date = new DevExpress.XtraEditors.LabelControl();
this.pl_bottom = new DevExpress.XtraEditors.PanelControl(); this.pl_bottom = new DevExpress.XtraEditors.PanelControl();
@@ -63,8 +47,26 @@
this.btnOkAudit = new DevExpress.XtraEditors.SimpleButton(); this.btnOkAudit = new DevExpress.XtraEditors.SimpleButton();
this.btnBackAudit = new DevExpress.XtraEditors.SimpleButton(); this.btnBackAudit = new DevExpress.XtraEditors.SimpleButton();
this.btnRefresh = new DevExpress.XtraEditors.SimpleButton(); this.btnRefresh = new DevExpress.XtraEditors.SimpleButton();
((System.ComponentModel.ISupportInitialize)(this.tabMain)).BeginInit(); this.tabpage_finish = new DevExpress.XtraTab.XtraTabPage();
this.tabMain.SuspendLayout(); this.gridFinish = new Lskj.Control.GridControlEx();
this.splitBelow = new DevExpress.XtraEditors.SplitContainerControl();
this.gridFlow = new Lskj.Control.GridControlEx();
this.gridDetail = new Lskj.Control.GridControlEx();
this.pl_top = new DevExpress.XtraEditors.PanelControl();
this.pl_top_searchCond = new DevExpress.XtraEditors.PanelControl();
this.labeldate_start = new Lskj.Control.LabelCheckDateEdit();
this.labelcheck_finalAuditor = new Lskj.Control.LabelCheckAutoTextEdit();
this.labeltxt_dataFlag = new Lskj.Control.LabelTextEdit();
this.btnSearch = new DevExpress.XtraEditors.SimpleButton();
this.labeldate_end = new Lskj.Control.LabelCheckDateEdit();
this.pl_top_right = new DevExpress.XtraEditors.PanelControl();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
this.btnBack = new DevExpress.XtraEditors.SimpleButton();
this.tabMain = new DevExpress.XtraTab.XtraTabControl();
((System.ComponentModel.ISupportInitialize)(this.pl_bottom)).BeginInit();
this.pl_bottom.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.p_menu)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.barManager1)).BeginInit();
this.tabpage_finish.SuspendLayout(); this.tabpage_finish.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitBelow)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitBelow)).BeginInit();
this.splitBelow.SuspendLayout(); this.splitBelow.SuspendLayout();
@@ -74,24 +76,166 @@
this.pl_top_searchCond.SuspendLayout(); this.pl_top_searchCond.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pl_top_right)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pl_top_right)).BeginInit();
this.pl_top_right.SuspendLayout(); this.pl_top_right.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pl_bottom)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tabMain)).BeginInit();
this.pl_bottom.SuspendLayout(); this.tabMain.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.p_menu)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.barManager1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// tabMain // label_tips
// //
this.tabMain.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; this.label_tips.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.tabMain.Dock = System.Windows.Forms.DockStyle.Fill; this.label_tips.Appearance.ForeColor = System.Drawing.Color.Red;
this.tabMain.HeaderLocation = DevExpress.XtraTab.TabHeaderLocation.Bottom; this.label_tips.Location = new System.Drawing.Point(221, 9);
this.tabMain.Location = new System.Drawing.Point(0, 0); this.label_tips.Name = "label_tips";
this.tabMain.Name = "tabMain"; this.label_tips.Size = new System.Drawing.Size(204, 12);
this.tabMain.SelectedTabPage = this.tabpage_finish; this.label_tips.TabIndex = 4;
this.tabMain.Size = new System.Drawing.Size(1051, 701); this.label_tips.Text = "友情提示:双击单据信息进入单据审核";
this.tabMain.TabIndex = 20; //
this.tabMain.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { // label_date
this.tabpage_finish}); //
this.label_date.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.label_date.Appearance.ForeColor = System.Drawing.Color.Red;
this.label_date.Location = new System.Drawing.Point(7, 9);
this.label_date.Name = "label_date";
this.label_date.Size = new System.Drawing.Size(198, 12);
this.label_date.TabIndex = 3;
this.label_date.Text = "上次刷新时间:2014-12-15 12:30:30";
//
// pl_bottom
//
this.pl_bottom.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.pl_bottom.Controls.Add(this.btnReverseSelection);
this.pl_bottom.Controls.Add(this.btnSelectAll);
this.pl_bottom.Controls.Add(this.dpb_Tools);
this.pl_bottom.Controls.Add(this.btnOkAudit);
this.pl_bottom.Controls.Add(this.btnBackAudit);
this.pl_bottom.Controls.Add(this.btnRefresh);
this.pl_bottom.Controls.Add(this.label_tips);
this.pl_bottom.Controls.Add(this.label_date);
this.pl_bottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pl_bottom.Location = new System.Drawing.Point(0, 1036);
this.pl_bottom.Name = "pl_bottom";
this.pl_bottom.Size = new System.Drawing.Size(1576, 36);
this.pl_bottom.TabIndex = 21;
//
// btnReverseSelection
//
this.btnReverseSelection.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnReverseSelection.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.btnReverseSelection.Appearance.Options.UseFont = true;
this.btnReverseSelection.Location = new System.Drawing.Point(1111, 7);
this.btnReverseSelection.Name = "btnReverseSelection";
this.btnReverseSelection.Size = new System.Drawing.Size(55, 26);
this.btnReverseSelection.TabIndex = 13;
this.btnReverseSelection.Text = "反选";
this.btnReverseSelection.Visible = false;
this.btnReverseSelection.Click += new System.EventHandler(this.btnReverseSelection_Click);
//
// btnSelectAll
//
this.btnSelectAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSelectAll.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.btnSelectAll.Appearance.Options.UseFont = true;
this.btnSelectAll.Location = new System.Drawing.Point(1172, 7);
this.btnSelectAll.Name = "btnSelectAll";
this.btnSelectAll.Size = new System.Drawing.Size(55, 26);
this.btnSelectAll.TabIndex = 12;
this.btnSelectAll.Text = "全选";
this.btnSelectAll.Visible = false;
this.btnSelectAll.Click += new System.EventHandler(this.btnSelectAll_Click);
//
// dpb_Tools
//
this.dpb_Tools.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.dpb_Tools.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dpb_Tools.Appearance.Options.UseFont = true;
this.dpb_Tools.DropDownArrowStyle = DevExpress.XtraEditors.DropDownArrowStyle.Show;
this.dpb_Tools.DropDownControl = this.p_menu;
this.dpb_Tools.Location = new System.Drawing.Point(1413, 7);
this.dpb_Tools.Name = "dpb_Tools";
this.dpb_Tools.Size = new System.Drawing.Size(80, 26);
this.dpb_Tools.TabIndex = 11;
this.dpb_Tools.Text = "常用工具";
//
// p_menu
//
this.p_menu.Manager = this.barManager1;
this.p_menu.MenuDrawMode = DevExpress.XtraBars.MenuDrawMode.SmallImagesText;
this.p_menu.Name = "p_menu";
//
// barManager1
//
this.barManager1.DockControls.Add(this.barDockControlTop);
this.barManager1.DockControls.Add(this.barDockControlBottom);
this.barManager1.DockControls.Add(this.barDockControlLeft);
this.barManager1.DockControls.Add(this.barDockControlRight);
this.barManager1.Form = this;
this.barManager1.MaxItemId = 0;
//
// barDockControlTop
//
this.barDockControlTop.CausesValidation = false;
this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top;
this.barDockControlTop.Location = new System.Drawing.Point(0, 0);
this.barDockControlTop.Size = new System.Drawing.Size(1576, 0);
//
// barDockControlBottom
//
this.barDockControlBottom.CausesValidation = false;
this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.barDockControlBottom.Location = new System.Drawing.Point(0, 1072);
this.barDockControlBottom.Size = new System.Drawing.Size(1576, 0);
//
// barDockControlLeft
//
this.barDockControlLeft.CausesValidation = false;
this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
this.barDockControlLeft.Location = new System.Drawing.Point(0, 0);
this.barDockControlLeft.Size = new System.Drawing.Size(0, 1072);
//
// barDockControlRight
//
this.barDockControlRight.CausesValidation = false;
this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
this.barDockControlRight.Location = new System.Drawing.Point(1576, 0);
this.barDockControlRight.Size = new System.Drawing.Size(0, 1072);
//
// btnOkAudit
//
this.btnOkAudit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOkAudit.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.btnOkAudit.Appearance.Options.UseFont = true;
this.btnOkAudit.Location = new System.Drawing.Point(1233, 7);
this.btnOkAudit.Name = "btnOkAudit";
this.btnOkAudit.Size = new System.Drawing.Size(82, 26);
this.btnOkAudit.TabIndex = 7;
this.btnOkAudit.Text = "批量审核(Y)";
this.btnOkAudit.Visible = false;
this.btnOkAudit.Click += new System.EventHandler(this.OnBtnOkAuditClick);
//
// btnBackAudit
//
this.btnBackAudit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnBackAudit.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.btnBackAudit.Appearance.Options.UseFont = true;
this.btnBackAudit.Location = new System.Drawing.Point(1321, 7);
this.btnBackAudit.Name = "btnBackAudit";
this.btnBackAudit.Size = new System.Drawing.Size(86, 26);
this.btnBackAudit.TabIndex = 6;
this.btnBackAudit.Text = "批量返审(B)";
this.btnBackAudit.Visible = false;
this.btnBackAudit.Click += new System.EventHandler(this.OnBtnBackAuditClick);
//
// btnRefresh
//
this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnRefresh.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.btnRefresh.Appearance.Options.UseFont = true;
this.btnRefresh.Location = new System.Drawing.Point(1499, 7);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(72, 26);
this.btnRefresh.TabIndex = 5;
this.btnRefresh.Text = "刷新(R)";
this.btnRefresh.Click += new System.EventHandler(this.BtnReflash_Click);
// //
// tabpage_finish // tabpage_finish
// //
@@ -99,7 +243,7 @@
this.tabpage_finish.Controls.Add(this.splitBelow); this.tabpage_finish.Controls.Add(this.splitBelow);
this.tabpage_finish.Controls.Add(this.pl_top); this.tabpage_finish.Controls.Add(this.pl_top);
this.tabpage_finish.Name = "tabpage_finish"; this.tabpage_finish.Name = "tabpage_finish";
this.tabpage_finish.Size = new System.Drawing.Size(1045, 672); this.tabpage_finish.Size = new System.Drawing.Size(1570, 1007);
this.tabpage_finish.Text = "已完成单据"; this.tabpage_finish.Text = "已完成单据";
// //
// gridFinish // gridFinish
@@ -111,20 +255,20 @@
this.gridFinish.Margin = new System.Windows.Forms.Padding(4); this.gridFinish.Margin = new System.Windows.Forms.Padding(4);
this.gridFinish.Name = "gridFinish"; this.gridFinish.Name = "gridFinish";
this.gridFinish.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum; this.gridFinish.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
this.gridFinish.Size = new System.Drawing.Size(1045, 340); this.gridFinish.Size = new System.Drawing.Size(1570, 675);
this.gridFinish.SysModel = null; this.gridFinish.SysModel = null;
this.gridFinish.TabIndex = 29; this.gridFinish.TabIndex = 29;
// //
// splitBelow // splitBelow
// //
this.splitBelow.Dock = System.Windows.Forms.DockStyle.Bottom; this.splitBelow.Dock = System.Windows.Forms.DockStyle.Bottom;
this.splitBelow.Location = new System.Drawing.Point(0, 379); this.splitBelow.Location = new System.Drawing.Point(0, 714);
this.splitBelow.Name = "splitBelow"; this.splitBelow.Name = "splitBelow";
this.splitBelow.Panel1.Controls.Add(this.gridFlow); this.splitBelow.Panel1.Controls.Add(this.gridFlow);
this.splitBelow.Panel1.Text = "Panel1"; this.splitBelow.Panel1.Text = "Panel1";
this.splitBelow.Panel2.Controls.Add(this.gridDetail); this.splitBelow.Panel2.Controls.Add(this.gridDetail);
this.splitBelow.Panel2.Text = "Panel2"; this.splitBelow.Panel2.Text = "Panel2";
this.splitBelow.Size = new System.Drawing.Size(1045, 293); this.splitBelow.Size = new System.Drawing.Size(1570, 293);
this.splitBelow.SplitterPosition = 453; this.splitBelow.SplitterPosition = 453;
this.splitBelow.TabIndex = 28; this.splitBelow.TabIndex = 28;
this.splitBelow.Text = "splitContainerControl1"; this.splitBelow.Text = "splitContainerControl1";
@@ -149,7 +293,7 @@
this.gridDetail.Margin = new System.Windows.Forms.Padding(4); this.gridDetail.Margin = new System.Windows.Forms.Padding(4);
this.gridDetail.Name = "gridDetail"; this.gridDetail.Name = "gridDetail";
this.gridDetail.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum; this.gridDetail.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
this.gridDetail.Size = new System.Drawing.Size(587, 293); this.gridDetail.Size = new System.Drawing.Size(1112, 293);
this.gridDetail.SysModel = null; this.gridDetail.SysModel = null;
this.gridDetail.TabIndex = 20; this.gridDetail.TabIndex = 20;
// //
@@ -160,7 +304,7 @@
this.pl_top.Dock = System.Windows.Forms.DockStyle.Top; this.pl_top.Dock = System.Windows.Forms.DockStyle.Top;
this.pl_top.Location = new System.Drawing.Point(0, 0); this.pl_top.Location = new System.Drawing.Point(0, 0);
this.pl_top.Name = "pl_top"; this.pl_top.Name = "pl_top";
this.pl_top.Size = new System.Drawing.Size(1045, 39); this.pl_top.Size = new System.Drawing.Size(1570, 39);
this.pl_top.TabIndex = 25; this.pl_top.TabIndex = 25;
// //
// pl_top_searchCond // pl_top_searchCond
@@ -174,7 +318,7 @@
this.pl_top_searchCond.Dock = System.Windows.Forms.DockStyle.Fill; this.pl_top_searchCond.Dock = System.Windows.Forms.DockStyle.Fill;
this.pl_top_searchCond.Location = new System.Drawing.Point(2, 2); this.pl_top_searchCond.Location = new System.Drawing.Point(2, 2);
this.pl_top_searchCond.Name = "pl_top_searchCond"; this.pl_top_searchCond.Name = "pl_top_searchCond";
this.pl_top_searchCond.Size = new System.Drawing.Size(778, 35); this.pl_top_searchCond.Size = new System.Drawing.Size(1303, 35);
this.pl_top_searchCond.TabIndex = 23; this.pl_top_searchCond.TabIndex = 23;
// //
// labeldate_start // labeldate_start
@@ -239,7 +383,7 @@
this.btnSearch.Name = "btnSearch"; this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(72, 26); this.btnSearch.Size = new System.Drawing.Size(72, 26);
this.btnSearch.TabIndex = 6; this.btnSearch.TabIndex = 6;
this.btnSearch.Text = "搜索(&Q)"; this.btnSearch.Text = "搜索(Q)";
this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click); this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
// //
// labeldate_end // labeldate_end
@@ -266,7 +410,7 @@
this.pl_top_right.Controls.Add(this.simpleButton1); this.pl_top_right.Controls.Add(this.simpleButton1);
this.pl_top_right.Controls.Add(this.btnBack); this.pl_top_right.Controls.Add(this.btnBack);
this.pl_top_right.Dock = System.Windows.Forms.DockStyle.Right; this.pl_top_right.Dock = System.Windows.Forms.DockStyle.Right;
this.pl_top_right.Location = new System.Drawing.Point(780, 2); this.pl_top_right.Location = new System.Drawing.Point(1305, 2);
this.pl_top_right.Name = "pl_top_right"; this.pl_top_right.Name = "pl_top_right";
this.pl_top_right.Size = new System.Drawing.Size(263, 35); this.pl_top_right.Size = new System.Drawing.Size(263, 35);
this.pl_top_right.TabIndex = 24; this.pl_top_right.TabIndex = 24;
@@ -292,165 +436,21 @@
this.btnBack.Name = "btnBack"; this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(82, 26); this.btnBack.Size = new System.Drawing.Size(82, 26);
this.btnBack.TabIndex = 8; this.btnBack.TabIndex = 8;
this.btnBack.Text = "返审(&W)"; this.btnBack.Text = "返审(W)";
this.btnBack.Click += new System.EventHandler(this.btnBack_Click); this.btnBack.Click += new System.EventHandler(this.btnBack_Click);
// //
// label_tips // tabMain
// //
this.label_tips.Appearance.Font = new System.Drawing.Font("宋体", 9F); this.tabMain.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.label_tips.Appearance.ForeColor = System.Drawing.Color.Red; this.tabMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.label_tips.Location = new System.Drawing.Point(221, 9); this.tabMain.HeaderLocation = DevExpress.XtraTab.TabHeaderLocation.Bottom;
this.label_tips.Name = "label_tips"; this.tabMain.Location = new System.Drawing.Point(0, 0);
this.label_tips.Size = new System.Drawing.Size(204, 12); this.tabMain.Name = "tabMain";
this.label_tips.TabIndex = 4; this.tabMain.SelectedTabPage = this.tabpage_finish;
this.label_tips.Text = "友情提示:双击单据信息进入单据审核"; this.tabMain.Size = new System.Drawing.Size(1576, 1036);
// this.tabMain.TabIndex = 20;
// label_date this.tabMain.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] {
// this.tabpage_finish});
this.label_date.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.label_date.Appearance.ForeColor = System.Drawing.Color.Red;
this.label_date.Location = new System.Drawing.Point(7, 9);
this.label_date.Name = "label_date";
this.label_date.Size = new System.Drawing.Size(198, 12);
this.label_date.TabIndex = 3;
this.label_date.Text = "上次刷新时间:2014-12-15 12:30:30";
//
// pl_bottom
//
this.pl_bottom.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
this.pl_bottom.Controls.Add(this.btnReverseSelection);
this.pl_bottom.Controls.Add(this.btnSelectAll);
this.pl_bottom.Controls.Add(this.dpb_Tools);
this.pl_bottom.Controls.Add(this.btnOkAudit);
this.pl_bottom.Controls.Add(this.btnBackAudit);
this.pl_bottom.Controls.Add(this.btnRefresh);
this.pl_bottom.Controls.Add(this.label_tips);
this.pl_bottom.Controls.Add(this.label_date);
this.pl_bottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pl_bottom.Location = new System.Drawing.Point(0, 693);
this.pl_bottom.Name = "pl_bottom";
this.pl_bottom.Size = new System.Drawing.Size(1051, 21);
this.pl_bottom.TabIndex = 21;
//
// btnReverseSelection
//
this.btnReverseSelection.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnReverseSelection.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.btnReverseSelection.Appearance.Options.UseFont = true;
this.btnReverseSelection.Location = new System.Drawing.Point(586, -8);
this.btnReverseSelection.Name = "btnReverseSelection";
this.btnReverseSelection.Size = new System.Drawing.Size(55, 26);
this.btnReverseSelection.TabIndex = 13;
this.btnReverseSelection.Text = "反选";
this.btnReverseSelection.Visible = false;
this.btnReverseSelection.Click += new System.EventHandler(this.btnReverseSelection_Click);
//
// btnSelectAll
//
this.btnSelectAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSelectAll.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.btnSelectAll.Appearance.Options.UseFont = true;
this.btnSelectAll.Location = new System.Drawing.Point(647, -8);
this.btnSelectAll.Name = "btnSelectAll";
this.btnSelectAll.Size = new System.Drawing.Size(55, 26);
this.btnSelectAll.TabIndex = 12;
this.btnSelectAll.Text = "全选";
this.btnSelectAll.Visible = false;
this.btnSelectAll.Click += new System.EventHandler(this.btnSelectAll_Click);
//
// dpb_Tools
//
this.dpb_Tools.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.dpb_Tools.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dpb_Tools.Appearance.Options.UseFont = true;
this.dpb_Tools.DropDownArrowStyle = DevExpress.XtraEditors.DropDownArrowStyle.Show;
this.dpb_Tools.DropDownControl = this.p_menu;
this.dpb_Tools.Location = new System.Drawing.Point(888, -8);
this.dpb_Tools.Name = "dpb_Tools";
this.dpb_Tools.Size = new System.Drawing.Size(80, 26);
this.dpb_Tools.TabIndex = 11;
this.dpb_Tools.Text = "常用工具";
//
// p_menu
//
this.p_menu.Manager = this.barManager1;
this.p_menu.MenuDrawMode = DevExpress.XtraBars.MenuDrawMode.SmallImagesText;
this.p_menu.Name = "p_menu";
//
// barManager1
//
this.barManager1.DockControls.Add(this.barDockControlTop);
this.barManager1.DockControls.Add(this.barDockControlBottom);
this.barManager1.DockControls.Add(this.barDockControlLeft);
this.barManager1.DockControls.Add(this.barDockControlRight);
this.barManager1.Form = this;
this.barManager1.MaxItemId = 0;
//
// barDockControlTop
//
this.barDockControlTop.CausesValidation = false;
this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top;
this.barDockControlTop.Location = new System.Drawing.Point(0, 0);
this.barDockControlTop.Size = new System.Drawing.Size(1051, 0);
//
// barDockControlBottom
//
this.barDockControlBottom.CausesValidation = false;
this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.barDockControlBottom.Location = new System.Drawing.Point(0, 715);
this.barDockControlBottom.Size = new System.Drawing.Size(1051, 0);
//
// barDockControlLeft
//
this.barDockControlLeft.CausesValidation = false;
this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
this.barDockControlLeft.Location = new System.Drawing.Point(0, 0);
this.barDockControlLeft.Size = new System.Drawing.Size(0, 715);
//
// barDockControlRight
//
this.barDockControlRight.CausesValidation = false;
this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
this.barDockControlRight.Location = new System.Drawing.Point(1051, 0);
this.barDockControlRight.Size = new System.Drawing.Size(0, 715);
//
// btnOkAudit
//
this.btnOkAudit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOkAudit.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.btnOkAudit.Appearance.Options.UseFont = true;
this.btnOkAudit.Location = new System.Drawing.Point(708, -8);
this.btnOkAudit.Name = "btnOkAudit";
this.btnOkAudit.Size = new System.Drawing.Size(82, 26);
this.btnOkAudit.TabIndex = 7;
this.btnOkAudit.Text = "批量审核(&Y)";
this.btnOkAudit.Visible = false;
this.btnOkAudit.Click += new System.EventHandler(this.OnBtnOkAuditClick);
//
// btnBackAudit
//
this.btnBackAudit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnBackAudit.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.btnBackAudit.Appearance.Options.UseFont = true;
this.btnBackAudit.Location = new System.Drawing.Point(796, -8);
this.btnBackAudit.Name = "btnBackAudit";
this.btnBackAudit.Size = new System.Drawing.Size(86, 26);
this.btnBackAudit.TabIndex = 6;
this.btnBackAudit.Text = "批量返审(&B)";
this.btnBackAudit.Visible = false;
this.btnBackAudit.Click += new System.EventHandler(this.OnBtnBackAuditClick);
//
// btnRefresh
//
this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnRefresh.Appearance.Font = new System.Drawing.Font("宋体", 9F);
this.btnRefresh.Appearance.Options.UseFont = true;
this.btnRefresh.Location = new System.Drawing.Point(974, -8);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(72, 26);
this.btnRefresh.TabIndex = 5;
this.btnRefresh.Text = "刷新(&R)";
this.btnRefresh.Click += new System.EventHandler(this.BtnReflash_Click);
// //
// AuditPanelEx // AuditPanelEx
// //
@@ -463,8 +463,11 @@
this.Controls.Add(this.barDockControlTop); this.Controls.Add(this.barDockControlTop);
this.Name = "AuditPanelEx"; this.Name = "AuditPanelEx";
this.Size = new System.Drawing.Size(1576, 1072); this.Size = new System.Drawing.Size(1576, 1072);
((System.ComponentModel.ISupportInitialize)(this.tabMain)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pl_bottom)).EndInit();
this.tabMain.ResumeLayout(false); this.pl_bottom.ResumeLayout(false);
this.pl_bottom.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.p_menu)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit();
this.tabpage_finish.ResumeLayout(false); this.tabpage_finish.ResumeLayout(false);
this.tabpage_finish.PerformLayout(); this.tabpage_finish.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitBelow)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitBelow)).EndInit();
@@ -475,18 +478,14 @@
this.pl_top_searchCond.ResumeLayout(false); this.pl_top_searchCond.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pl_top_right)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pl_top_right)).EndInit();
this.pl_top_right.ResumeLayout(false); this.pl_top_right.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pl_bottom)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tabMain)).EndInit();
this.pl_bottom.ResumeLayout(false); this.tabMain.ResumeLayout(false);
this.pl_bottom.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.p_menu)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
#endregion #endregion
private DevExpress.XtraTab.XtraTabControl tabMain;
private DevExpress.XtraEditors.LabelControl label_date; private DevExpress.XtraEditors.LabelControl label_date;
private DevExpress.XtraEditors.LabelControl label_tips; private DevExpress.XtraEditors.LabelControl label_tips;
private DevExpress.XtraEditors.PanelControl pl_bottom; private DevExpress.XtraEditors.PanelControl pl_bottom;
@@ -502,7 +501,12 @@
private DevExpress.XtraBars.BarDockControl barDockControlRight; private DevExpress.XtraBars.BarDockControl barDockControlRight;
private DevExpress.XtraEditors.SimpleButton btnSelectAll; private DevExpress.XtraEditors.SimpleButton btnSelectAll;
private DevExpress.XtraEditors.SimpleButton btnReverseSelection; private DevExpress.XtraEditors.SimpleButton btnReverseSelection;
private DevExpress.XtraTab.XtraTabControl tabMain;
private DevExpress.XtraTab.XtraTabPage tabpage_finish; private DevExpress.XtraTab.XtraTabPage tabpage_finish;
private GridControlEx gridFinish;
private DevExpress.XtraEditors.SplitContainerControl splitBelow;
private GridControlEx gridFlow;
private GridControlEx gridDetail;
private DevExpress.XtraEditors.PanelControl pl_top; private DevExpress.XtraEditors.PanelControl pl_top;
private DevExpress.XtraEditors.PanelControl pl_top_searchCond; private DevExpress.XtraEditors.PanelControl pl_top_searchCond;
private LabelCheckDateEdit labeldate_start; private LabelCheckDateEdit labeldate_start;
@@ -513,9 +517,5 @@
private DevExpress.XtraEditors.PanelControl pl_top_right; private DevExpress.XtraEditors.PanelControl pl_top_right;
private DevExpress.XtraEditors.SimpleButton simpleButton1; private DevExpress.XtraEditors.SimpleButton simpleButton1;
private DevExpress.XtraEditors.SimpleButton btnBack; private DevExpress.XtraEditors.SimpleButton btnBack;
private DevExpress.XtraEditors.SplitContainerControl splitBelow;
private GridControlEx gridFlow;
private GridControlEx gridFinish;
private GridControlEx gridDetail;
} }
} }
+24 -2
View File
@@ -42,10 +42,29 @@ namespace Lskj.Control
public partial class AuditPanelEx : UserControl public partial class AuditPanelEx : UserControl
{ {
private bool mResourcesReleased; private bool mResourcesReleased;
private readonly AltButtonShortcutManager mAltButtonShortcuts =
new AltButtonShortcutManager();
public AuditPanelEx() public AuditPanelEx()
{ {
InitializeComponent(); InitializeComponent();
InitializeAltButtonShortcuts();
}
private void InitializeAltButtonShortcuts()
{
mAltButtonShortcuts.Register(btnOkAudit, Keys.Y);
mAltButtonShortcuts.Register(btnBackAudit, Keys.B);
mAltButtonShortcuts.Register(btnRefresh, Keys.R);
mAltButtonShortcuts.Register(btnBack, Keys.W);
mAltButtonShortcuts.Register(btnSearch, Keys.Q);
}
protected override bool ProcessCmdKey(
ref System.Windows.Forms.Message msg, Keys keyData)
{
return mAltButtonShortcuts.ProcessKey(keyData) ||
base.ProcessCmdKey(ref msg, keyData);
} }
internal void ReleaseResourcesForDispose() internal void ReleaseResourcesForDispose()
@@ -94,7 +113,7 @@ namespace Lskj.Control
{ {
if (SysModel != null && SysModel.DataCaches != null) if (SysModel != null && SysModel.DataCaches != null)
{ {
SysModel.DataCaches.Remove(this); SysModel.DataCaches.RemoveCache(this);
} }
} }
catch catch
@@ -673,6 +692,9 @@ namespace Lskj.Control
gridPanel.Dock = DockStyle.Right; gridPanel.Dock = DockStyle.Right;
gridPanel.BorderStyle = BorderStyles.NoBorder; gridPanel.BorderStyle = BorderStyles.NoBorder;
GridControlEx grid = new GridControlEx(); GridControlEx grid = new GridControlEx();
grid.Model = this.SysModel;
if (dataCaches != null) if (dataCaches != null)
{ {
grid.GetDataCaches(dataCaches, modelkeyName + key); grid.GetDataCaches(dataCaches, modelkeyName + key);
@@ -693,7 +715,7 @@ namespace Lskj.Control
grid.SetGridRightMenus(dtGridRightMenus, SysModel); grid.SetGridRightMenus(dtGridRightMenus, SysModel);
grid.GridView.Tag = accrModel; grid.GridView.Tag = accrModel;
grid.GridView.DoubleClick += new EventHandler(OnGridViewDoubleClick); grid.GridView.DoubleClick += new EventHandler(OnGridViewDoubleClick);
grid.Model = this.SysModel; //grid.Model = this.SysModel;
// 追加复选框用于批量审批 // 追加复选框用于批量审批
if (BaseAccraditModelObj.MuitlAuditFlag || BaseAccraditModelObj.MuitlAuditBackFlag) if (BaseAccraditModelObj.MuitlAuditFlag || BaseAccraditModelObj.MuitlAuditBackFlag)
{ {
+4 -2
View File
@@ -75,12 +75,14 @@ namespace Lskj.Control
case ControlType.LabDate: case ControlType.LabDate:
case ControlType.LabDateTime: case ControlType.LabDateTime:
case ControlType.LabDateTimeShort: case ControlType.LabDateTimeShort:
case ControlType.LabTime:
case ControlType.LabShortTime:
// 日期控件 // 日期控件
LabelDateEdit dateEdit = this as LabelDateEdit; LabelDateEdit dateEdit = this as LabelDateEdit;
UpdContrast = dateEdit.TextEdit.EditValue == null ? dateEdit.EditText : dateEdit.TextEdit.EditValue.ToString(); UpdContrast = dateEdit.TextEdit.EditValue == null ? dateEdit.EditText : dateEdit.TextEdit.EditValue.ToString();
break; break;
case ControlType.LabTime:
case ControlType.LabShortTime:
LabelTimeEdit timeEdit = this as LabelTimeEdit;
return timeEdit != null && !timeEdit.IsSameTime(this.Model.Text);
} }
return this.Model == null || this.Model.Text == null || !this.Model.Text.Equals(UpdContrast, StringComparison.OrdinalIgnoreCase); return this.Model == null || this.Model.Text == null || !this.Model.Text.Equals(UpdContrast, StringComparison.OrdinalIgnoreCase);
} }
+60 -109
View File
@@ -78,17 +78,17 @@ namespace Lskj.Control.BrowserSetting
string arg2 = message.Arguments.GetString(2); string arg2 = message.Arguments.GetString(2);
string arg3 = message.Arguments.GetString(3); string arg3 = message.Arguments.GetString(3);
string arg4 = message.Arguments.GetString(4); string arg4 = message.Arguments.GetString(4);
PostToUiThread( if (ERPInfo.Instance.MainControl.InvokeRequired)
ERPInfo.Instance.MainControl,
delegate
{ {
BsOpenModuleHandler.OpenModule( ERPInfo.Instance.MainControl.Invoke(new Action(() =>
arg0, {
arg1, BsOpenModuleHandler.OpenModule(arg0, arg1, arg2, arg3, arg4);
arg2, }));
arg3, }
arg4); else
}); {
BrowserSetting.BsOpenModuleHandler.OpenModule(arg0, arg1, arg2, arg3, arg4);
}
} }
else if (message.Name.Equals("OpenOnRightClick")) else if (message.Name.Equals("OpenOnRightClick"))
{ {
@@ -96,103 +96,75 @@ namespace Lskj.Control.BrowserSetting
string arg1 = message.Arguments.GetString(1); string arg1 = message.Arguments.GetString(1);
string arg2 = message.Arguments.GetString(2); string arg2 = message.Arguments.GetString(2);
string arg3 = message.Arguments.GetString(3); string arg3 = message.Arguments.GetString(3);
PostToUiThread( if (ERPInfo.Instance.MainControl.InvokeRequired)
ERPInfo.Instance.MainControl,
delegate
{ {
BsOpenModuleHandler.OpenRightModule( ERPInfo.Instance.MainControl.Invoke(new Action(() =>
arg0, {
arg1, BsOpenModuleHandler.OpenRightModule(arg0, arg1, arg2, arg3);
arg2, }));
arg3); }
}); else
{
BsOpenModuleHandler.OpenRightModule(arg0, arg1, arg2, arg3);
}
} }
else if (message.Name.Equals("CloseWin")) else if (message.Name.Equals("CloseWin"))
{ {
var browserControl = frmWebBrowser; if (frmWebBrowser != null && frmWebBrowser.Parent != null && frmWebBrowser.Parent.Parent != null && frmWebBrowser.Parent.Parent is BaseForm baseForm)
PostToUiThread( {
browserControl, if (baseForm.InvokeRequired)
delegate {
baseForm.Invoke(new Action(() =>
{ {
// Parent/Parent is a WinForms control-tree read and must
// not run on CEF's UI thread.
var parent = browserControl.Parent;
var baseForm = parent == null
? null
: parent.Parent as BaseForm;
if (baseForm == null || baseForm.IsDisposed)
return;
baseForm.DialogResult = DialogResult.OK; baseForm.DialogResult = DialogResult.OK;
baseForm.Close(); baseForm.Close();
}); }));
}
else
{
baseForm.DialogResult = DialogResult.OK;
baseForm.Close();
}
}
} }
else if (message.Name.Equals("SelectPro")) else if (message.Name.Equals("SelectPro"))
{ {
string arg0 = message.Arguments.GetString(0); string arg0 = message.Arguments.GetString(0);
string arg1 = message.Arguments.GetString(1); string arg1 = message.Arguments.GetString(1);
bool isclose = arg1!=null&&!string.IsNullOrWhiteSpace(arg1) && arg1.Equals("1") ? true : false; bool isclose = arg1!=null&&!string.IsNullOrWhiteSpace(arg1) && arg1.Equals("1") ? true : false;
var browserControl = frmWebBrowser; if (frmWebBrowser != null && frmWebBrowser.Parent != null && frmWebBrowser.Parent.Parent != null && frmWebBrowser.Parent.Parent is BaseForm baseForm)
PostToUiThread( {
browserControl, if (baseForm.InvokeRequired)
delegate {
baseForm.Invoke(new Action(() =>
{ {
var parent = browserControl.Parent;
var baseForm = parent == null
? null
: parent.Parent as BaseForm;
if (baseForm == null || baseForm.IsDisposed)
return;
BsOpenModuleHandler.AddReturnRow(arg0); BsOpenModuleHandler.AddReturnRow(arg0);
if (isclose) if (isclose)
{ {
baseForm.DialogResult = DialogResult.OK; baseForm.DialogResult = DialogResult.OK;
baseForm.Close(); baseForm.Close();
} }
});
}));
}
else
{
BsOpenModuleHandler.AddReturnRow(arg0);
if (isclose)
{
baseForm.DialogResult = DialogResult.OK;
baseForm.Close();
}
}
}
} }
return base.OnProcessMessageReceived(browser, frame, sourceProcess, message); return base.OnProcessMessageReceived(browser, frame, sourceProcess, message);
} }
private static void PostToUiThread(
System.Windows.Forms.Control control,
Action action)
{
if (control == null || action == null || control.IsDisposed ||
!control.IsHandleCreated)
return;
Action guardedAction = delegate
{
if (control.IsDisposed)
return;
try
{
action();
}
catch (Exception exception)
{
ReportProcessMessageFailure(exception);
}
};
try
{
// CEF invokes OnProcessMessageReceived on its UI thread. A
// synchronous Control.Invoke can block that thread inside a
// modal dialog while the dialog waits for CEF to create its
// browser. Always queue the operation and return to CEF first.
control.BeginInvoke(guardedAction);
}
catch (Exception exception)
{
ReportProcessMessageFailure(exception);
}
}
private static void ReportProcessMessageFailure(Exception exception) private static void ReportProcessMessageFailure(Exception exception)
{ {
try try
@@ -201,10 +173,10 @@ namespace Lskj.Control.BrowserSetting
} }
catch catch
{ {
// Never propagate logging failures into a native CEF callback. // Logging must never rethrow across the native CEF callback.
} }
Action showError = delegate Action showError = () =>
{ {
try try
{ {
@@ -212,14 +184,14 @@ namespace Lskj.Control.BrowserSetting
} }
catch catch
{ {
// Error reporting must never terminate the browser callback.
} }
}; };
try try
{ {
System.Windows.Forms.Control mainControl = ERPInfo.Instance.MainControl; System.Windows.Forms.Control mainControl = ERPInfo.Instance.MainControl;
if (mainControl == null || mainControl.IsDisposed || if (mainControl == null || mainControl.IsDisposed || !mainControl.IsHandleCreated)
!mainControl.IsHandleCreated)
return; return;
if (mainControl.InvokeRequired) if (mainControl.InvokeRequired)
@@ -229,36 +201,15 @@ namespace Lskj.Control.BrowserSetting
} }
catch catch
{ {
// The main window may close while the callback is reporting. // The main window may close while the CEF callback is reporting.
} }
} }
public void Created(CefBrowser cefBrowser) public void Created(CefBrowser cefBrowser)
{ {
if (frmWebBrowser != null && OnCreated != null) if (OnCreated != null)
{ {
OnCreated(cefBrowser, EventArgs.Empty); OnCreated(cefBrowser, EventArgs.Empty);
} }
} }
public bool Closing(CefBrowser browser)
{
var control = frmWebBrowser;
return control != null && control.BrowserClosing(browser);
}
public void Closed(CefBrowser browser)
{
var control = frmWebBrowser;
if (control != null)
{
control.BrowserClosed(browser);
if (control.cefBrowserSettings == null)
{
frmWebBrowser = null;
OnCreated = null;
}
}
}
} }
} }
@@ -42,7 +42,7 @@ namespace Lskj.Control.BrowserSetting
} }
if (BsClient != null && BsClient.frmWebBrowser != null && BsClient.frmWebBrowser.Parent != null && BsClient.frmWebBrowser.Parent.Name.Equals("previewFrm")) if (BsClient != null && BsClient.frmWebBrowser != null && BsClient.frmWebBrowser.Parent != null && BsClient.frmWebBrowser.Parent.Name.Equals("previewFrm"))
{ {
BsClient.frmWebBrowser.CloseBrowser(); browser.GetHost().CloseBrowser();
} }
else if (BsClient != null && BsClient.frmWebBrowser != null) else if (BsClient != null && BsClient.frmWebBrowser != null)
{ {
@@ -196,24 +196,11 @@ namespace Lskj.Control.BrowserSetting
try try
{ {
if (browser == null) return null; if (browser == null) return null;
IntPtr browserHandle; IntPtr browserHandle = browser.GetHost().GetWindowHandle();
using (var browserHost = browser.GetHost())
{
browserHandle = browserHost.GetWindowHandle();
}
if (browserHandle == IntPtr.Zero) return null; if (browserHandle == IntPtr.Zero) return null;
IntPtr parentHandle = GetParent(browserHandle); IntPtr parentHandle = GetParent(browserHandle);
System.Windows.Forms.Control control = null; if (parentHandle == IntPtr.Zero) return null;
while (parentHandle != IntPtr.Zero && control == null) System.Windows.Forms.Control control = System.Windows.Forms.Control.FromHandle(parentHandle);
{
// The CEF child now sits inside an application-owned native
// host. Walk through that host to preserve the original
// FrmWebBrowser-based module lookup.
control = System.Windows.Forms.Control.FromHandle(parentHandle);
parentHandle = GetParent(parentHandle);
}
if (control == null) return null;
if (control != null && control.Parent != null && control.Parent.Parent != null) if (control != null && control.Parent != null && control.Parent.Parent != null)
{ {
@@ -20,20 +20,9 @@ namespace Lskj.Control.BrowserSetting
base.OnAfterCreated(browser); base.OnAfterCreated(browser);
BsClient.Created(browser); BsClient.Created(browser);
} }
protected override bool DoClose(CefBrowser browser)
{
// CEF sends WM_CLOSE to the parked application-owned host after
// this callback. The host only allows that second close attempt.
return BsClient.Closing(browser);
}
protected override void OnBeforeClose(CefBrowser browser) protected override void OnBeforeClose(CefBrowser browser)
{ {
base.OnBeforeClose(browser); base.OnBeforeClose(browser);
// Release owner references after CEF completes its async close.
BsClient.Closed(browser);
} }
protected override bool OnBeforePopup( protected override bool OnBeforePopup(
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Xilium.CefGlue; using Xilium.CefGlue;
using Lskj.Business;
namespace Lskj.Control.BrowserSetting namespace Lskj.Control.BrowserSetting
{ {
@@ -47,12 +46,7 @@ namespace Lskj.Control.BrowserSetting
protected override void OnRenderProcessTerminated(CefBrowser browser, CefTerminationStatus status) protected override void OnRenderProcessTerminated(CefBrowser browser, CefTerminationStatus status)
{ {
// Reloading immediately from this callback can create a new browser.Reload();
// renderer while the old one is tearing down and cause a native
// libcef crash loop. Record the termination and let the module
// lifecycle decide whether a later reopen is appropriate.
LogUtil.WriteError("CEF 渲染进程已终止,状态=" + status,
new InvalidOperationException("CEF renderer termination status=" + status));
} }
} }
@@ -1,6 +1,5 @@
using Lskj.Business; using Lskj.Business;
using Lskj.Model; using Lskj.Model;
using Lskj.Util;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -55,19 +54,6 @@ namespace Lskj.Control.BrowserSetting2
return contextMenuHandler; return contextMenuHandler;
} }
protected override bool OnProcessMessageReceived(CefBrowser browser, CefFrame frame, CefProcessId sourceProcess, CefProcessMessage message) protected override bool OnProcessMessageReceived(CefBrowser browser, CefFrame frame, CefProcessId sourceProcess, CefProcessMessage message)
{
try
{
return OnProcessMessageReceivedCore(browser, frame, sourceProcess, message);
}
catch (Exception exception)
{
ReportProcessMessageFailure(exception);
return true;
}
}
private bool OnProcessMessageReceivedCore(CefBrowser browser, CefFrame frame, CefProcessId sourceProcess, CefProcessMessage message)
{ {
if (message.Name.Equals("OpenModule")) if (message.Name.Equals("OpenModule"))
{ {
@@ -76,17 +62,17 @@ namespace Lskj.Control.BrowserSetting2
string arg2 = message.Arguments.GetString(2); string arg2 = message.Arguments.GetString(2);
string arg3 = message.Arguments.GetString(3); string arg3 = message.Arguments.GetString(3);
string arg4 = message.Arguments.GetString(4); string arg4 = message.Arguments.GetString(4);
PostToUiThread( if (ERPInfo.Instance.MainControl.InvokeRequired)
ERPInfo.Instance.MainControl,
delegate
{ {
BrowserSetting.BsOpenModuleHandler.OpenModule( ERPInfo.Instance.MainControl.Invoke(new Action(() =>
arg0, {
arg1, BrowserSetting.BsOpenModuleHandler.OpenModule(arg0, arg1, arg2, arg3, arg4);
arg2, }));
arg3, }
arg4); else
}); {
BrowserSetting.BsOpenModuleHandler.OpenModule(arg0, arg1, arg2, arg3, arg4);
}
} }
else if (message.Name.Equals("OpenOnRightClick")) else if (message.Name.Equals("OpenOnRightClick"))
{ {
@@ -94,140 +80,43 @@ namespace Lskj.Control.BrowserSetting2
string arg1 = message.Arguments.GetString(1); string arg1 = message.Arguments.GetString(1);
string arg2 = message.Arguments.GetString(2); string arg2 = message.Arguments.GetString(2);
string arg3 = message.Arguments.GetString(3); string arg3 = message.Arguments.GetString(3);
PostToUiThread( if (ERPInfo.Instance.MainControl.InvokeRequired)
ERPInfo.Instance.MainControl,
delegate
{ {
BrowserSetting.BsOpenModuleHandler.OpenRightModule( ERPInfo.Instance.MainControl.Invoke(new Action(() =>
arg0, {
arg1, BrowserSetting.BsOpenModuleHandler.OpenRightModule(arg0, arg1, arg2, arg3);
arg2, }));
arg3); }
}); else
{
BrowserSetting.BsOpenModuleHandler.OpenRightModule(arg0, arg1, arg2, arg3);
}
} }
else if (message.Name.Equals("CloseWin")) else if (message.Name.Equals("CloseWin"))
{ {
var browserControl = frmWebBrowser; if (frmWebBrowser != null && frmWebBrowser.Parent != null && frmWebBrowser.Parent.Parent != null && frmWebBrowser.Parent.Parent is BaseForm baseForm)
PostToUiThread( {
browserControl, if (baseForm.InvokeRequired)
delegate {
baseForm.Invoke(new Action(() =>
{ {
// Resolve the owning form only after returning to the
// WinForms UI thread.
var parent = browserControl.Parent;
var baseForm = parent == null
? null
: parent.Parent as BaseForm;
if (baseForm == null || baseForm.IsDisposed)
return;
baseForm.Close(); baseForm.Close();
}); }));
}
else
{
baseForm.Close();
}
}
} }
return base.OnProcessMessageReceived(browser, frame, sourceProcess, message); return base.OnProcessMessageReceived(browser, frame, sourceProcess, message);
} }
private static void PostToUiThread(
System.Windows.Forms.Control control,
Action action)
{
if (control == null || action == null || control.IsDisposed ||
!control.IsHandleCreated)
return;
Action guardedAction = delegate
{
if (control.IsDisposed)
return;
try
{
action();
}
catch (Exception exception)
{
ReportProcessMessageFailure(exception);
}
};
try
{
// Never keep CEF's UI thread blocked while WinForms opens a
// modal module that may create another CEF browser.
control.BeginInvoke(guardedAction);
}
catch (Exception exception)
{
ReportProcessMessageFailure(exception);
}
}
private static void ReportProcessMessageFailure(Exception exception)
{
try
{
LogHelper.Instance.WriteError(exception);
}
catch
{
// Never propagate logging failures into a native CEF callback.
}
Action showError = delegate
{
try
{
MessageUtil.Show(exception);
}
catch
{
}
};
try
{
System.Windows.Forms.Control mainControl = ERPInfo.Instance.MainControl;
if (mainControl == null || mainControl.IsDisposed ||
!mainControl.IsHandleCreated)
return;
if (mainControl.InvokeRequired)
mainControl.BeginInvoke(showError);
else
showError();
}
catch
{
// The main window may close while the callback is reporting.
}
}
public void Created(CefBrowser cefBrowser) public void Created(CefBrowser cefBrowser)
{ {
if (frmWebBrowser != null && OnCreated != null) if (OnCreated != null)
{ {
OnCreated(cefBrowser, EventArgs.Empty); OnCreated(cefBrowser, EventArgs.Empty);
} }
} }
public bool Closing(CefBrowser browser)
{
var control = frmWebBrowser;
return control != null && control.BrowserClosing(browser);
}
public void Closed(CefBrowser browser)
{
var control = frmWebBrowser;
if (control != null)
{
control.BrowserClosed(browser);
if (control.cefBrowserSettings == null)
{
frmWebBrowser = null;
OnCreated = null;
}
}
}
} }
} }
@@ -20,20 +20,9 @@ namespace Lskj.Control.BrowserSetting2
base.OnAfterCreated(browser); base.OnAfterCreated(browser);
BsClient.Created(browser); BsClient.Created(browser);
} }
protected override bool DoClose(CefBrowser browser)
{
// CEF sends WM_CLOSE to the parked application-owned host after
// this callback. The host only allows that second close attempt.
return BsClient.Closing(browser);
}
protected override void OnBeforeClose(CefBrowser browser) protected override void OnBeforeClose(CefBrowser browser)
{ {
base.OnBeforeClose(browser); base.OnBeforeClose(browser);
// Release owner references after CEF completes its async close.
BsClient.Closed(browser);
} }
protected override bool OnBeforePopup( protected override bool OnBeforePopup(
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Xilium.CefGlue; using Xilium.CefGlue;
using Lskj.Business;
namespace Lskj.Control.BrowserSetting2 namespace Lskj.Control.BrowserSetting2
{ {
@@ -47,9 +46,7 @@ namespace Lskj.Control.BrowserSetting2
protected override void OnRenderProcessTerminated(CefBrowser browser, CefTerminationStatus status) protected override void OnRenderProcessTerminated(CefBrowser browser, CefTerminationStatus status)
{ {
// Do not start a new renderer during native teardown. browser.Reload();
LogUtil.WriteError("CEF 渲染进程已终止,状态=" + status,
new InvalidOperationException("CEF renderer termination status=" + status));
} }
} }
@@ -15,6 +15,8 @@ namespace Lskj.Control
/// </summary> /// </summary>
internal sealed class CefBrowserLifetimeCoordinator internal sealed class CefBrowserLifetimeCoordinator
{ {
// CEF 生命周期诊断默认关闭,避免正常创建和销毁浏览器时持续写入日志。
internal static readonly bool LifecycleTracingEnabled = false;
private static readonly CefBrowserSettings _sharedBrowserSettings = private static readonly CefBrowserSettings _sharedBrowserSettings =
new CefBrowserSettings(); new CefBrowserSettings();
private readonly object _hostWindowSyncRoot = new object(); private readonly object _hostWindowSyncRoot = new object();
@@ -623,6 +625,9 @@ namespace Lskj.Control
private void TraceOwnerAction(string action) private void TraceOwnerAction(string action)
{ {
if (!LifecycleTracingEnabled)
return;
string stack = Environment.StackTrace string stack = Environment.StackTrace
.Replace("\r", string.Empty) .Replace("\r", string.Empty)
.Replace("\n", " | "); .Replace("\n", " | ");
@@ -637,6 +642,9 @@ namespace Lskj.Control
CefBrowser browser, CefBrowser browser,
CefBrowser currentBrowser) CefBrowser currentBrowser)
{ {
if (!LifecycleTracingEnabled)
return;
try try
{ {
LogHelper.Instance.WriteLog( LogHelper.Instance.WriteLog(
@@ -1079,6 +1087,9 @@ namespace Lskj.Control
bool closed, bool closed,
int timeoutMilliseconds) int timeoutMilliseconds)
{ {
if (!CefBrowserLifetimeCoordinator.LifecycleTracingEnabled)
return;
try try
{ {
int remaining; int remaining;
+14 -1
View File
@@ -143,6 +143,10 @@ namespace Lskj.Control
} }
bool isAdmin = ERPInfo.Instance.UserName.Equals("管理员"); bool isAdmin = ERPInfo.Instance.UserName.Equals("管理员");
this.btnCover.Visible = SysModel == null ? isAdmin : isAdmin ? true : SysModel.OperPermissionsUser.Contains(ERPInfo.Instance.UserName); this.btnCover.Visible = SysModel == null ? isAdmin : isAdmin ? true : SysModel.OperPermissionsUser.Contains(ERPInfo.Instance.UserName);
//if (SysModel!=null&&!string.IsNullOrWhiteSpace(SysModel.OperPermissionsUser) && SysModel.OperPermissionsUser.Equals("无")) this.btnCover.Visible = false;
this.SourceColumns = BaseImpl.GetDataTableResult(string.Format("select * from {0} where 1<>1", _tableName)).Columns; this.SourceColumns = BaseImpl.GetDataTableResult(string.Format("select * from {0} where 1<>1", _tableName)).Columns;
DataTable dtCalcFields = BaseImpl.GetDataTableResult(string.Format("select name from sys.columns where object_id=object_id('{0}') and is_computed=1", _tableName)); DataTable dtCalcFields = BaseImpl.GetDataTableResult(string.Format("select name from sys.columns where object_id=object_id('{0}') and is_computed=1", _tableName));
if ((dtCalcFields != null) && (dtCalcFields.Rows.Count > 0)) if ((dtCalcFields != null) && (dtCalcFields.Rows.Count > 0))
@@ -632,7 +636,11 @@ namespace Lskj.Control
} }
dt.AcceptChanges(); dt.AcceptChanges();
if (failedData.Rows.Count > 0 || !SystemInfo.Instance.SuppressImportSuccessTip)
{
XtraMessageBox.Show("数据导入完成,成功" + success.ToString() + "条,失败" + failed.ToString() + "条", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); XtraMessageBox.Show("数据导入完成,成功" + success.ToString() + "条,失败" + failed.ToString() + "条", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
if (failedData.Rows.Count > 0) if (failedData.Rows.Count > 0)
{ {
MessageUtil.Show(failedData.Rows[0]["import_errormsg"].ToString()); MessageUtil.Show(failedData.Rows[0]["import_errormsg"].ToString());
@@ -658,6 +666,9 @@ namespace Lskj.Control
} }
} }
if (failed == 0 && datatb.Rows.Count > 0) this._isImported = true;
datatb.Clear(); datatb.Clear();
dt.Clear(); dt.Clear();
if (failed > 0) if (failed > 0)
@@ -1026,7 +1037,7 @@ namespace Lskj.Control
{ {
if (MessageUtil.Show("如果导入数据量太多将花费较长时间,是否确认导入", MessageBoxButtons.YesNo) != DialogResult.Yes) if (MessageUtil.Show("如果导入数据量太多将花费较长时间,是否确认导入", MessageBoxButtons.YesNo) != DialogResult.Yes)
return; return;
this._isImported = true;
if (!this.DetermineImportConditions()) if (!this.DetermineImportConditions())
{ {
@@ -1038,6 +1049,8 @@ namespace Lskj.Control
// 采用存储过程保存 // 采用存储过程保存
//this.SaveImportData(table); //this.SaveImportData(table);
if(this._isImported&& SystemInfo.Instance.SuppressImportSuccessTip) this.DialogResult = DialogResult.OK;
} }
else else
{ {
-2
View File
@@ -14,8 +14,6 @@ namespace Lskj.Control
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing)
CloseBrowserForDispose();
if (disposing && (components != null)) if (disposing && (components != null))
{ {
components.Dispose(); components.Dispose();
-39
View File
@@ -109,45 +109,6 @@ namespace Lskj.Control
cefBrowserSettings.GetMainFrame().LoadUrl(webResponse.ResponseUri.AbsoluteUri); cefBrowserSettings.GetMainFrame().LoadUrl(webResponse.ResponseUri.AbsoluteUri);
} }
} }
internal bool BrowserClosing(CefBrowser browser)
{
return false;
}
internal void BrowserClosed(CefBrowser browser)
{
var currentBrowser = cefBrowserSettings;
if (currentBrowser == null || browser == null)
return;
bool sameBrowser = ReferenceEquals(currentBrowser, browser);
if (!sameBrowser)
{
try
{
sameBrowser = currentBrowser.IsSame(browser);
}
catch (Exception)
{
}
}
if (sameBrowser)
Interlocked.CompareExchange(ref cefBrowserSettings, null, currentBrowser);
}
internal void CloseBrowser()
{
var browser = cefBrowserSettings;
if (browser != null)
browser.GetHost().CloseBrowser();
}
private void CloseBrowserForDispose()
{
}
public static string ToEnUrl(string url) public static string ToEnUrl(string url)
{ {
string[] urlParams = url.Split('?'); string[] urlParams = url.Split('?');
-2
View File
@@ -14,8 +14,6 @@ namespace Lskj.Control
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing)
CloseBrowserForDispose();
if (disposing && (components != null)) if (disposing && (components != null))
{ {
components.Dispose(); components.Dispose();
-39
View File
@@ -126,45 +126,6 @@ namespace Lskj.Control
cefBrowserSettings.GetMainFrame().LoadUrl(webResponse.ResponseUri.AbsoluteUri); cefBrowserSettings.GetMainFrame().LoadUrl(webResponse.ResponseUri.AbsoluteUri);
} }
} }
internal bool BrowserClosing(CefBrowser browser)
{
return false;
}
internal void BrowserClosed(CefBrowser browser)
{
var currentBrowser = cefBrowserSettings;
if (currentBrowser == null || browser == null)
return;
bool sameBrowser = ReferenceEquals(currentBrowser, browser);
if (!sameBrowser)
{
try
{
sameBrowser = currentBrowser.IsSame(browser);
}
catch (Exception)
{
}
}
if (sameBrowser)
Interlocked.CompareExchange(ref cefBrowserSettings, null, currentBrowser);
}
internal void CloseBrowser()
{
var browser = cefBrowserSettings;
if (browser != null)
browser.GetHost().CloseBrowser();
}
private void CloseBrowserForDispose()
{
}
public static string ToEnUrl(string url) public static string ToEnUrl(string url)
{ {
string[] urlParams = url.Split('?'); string[] urlParams = url.Split('?');
+36
View File
@@ -637,6 +637,11 @@ namespace Lskj.Control
} }
_gridResourcesDisposed = true; _gridResourcesDisposed = true;
if (cellHelper != null)
{
cellHelper.Dispose();
cellHelper = null;
}
StopColumnSourceTimer(); StopColumnSourceTimer();
if (mTimer != null) if (mTimer != null)
{ {
@@ -4239,6 +4244,29 @@ namespace Lskj.Control
RepositoryItemTimeEdit timeEdit = new RepositoryItemTimeEdit(); RepositoryItemTimeEdit timeEdit = new RepositoryItemTimeEdit();
timeEdit.DisplayFormat.FormatString = timeEdit.EditFormat.FormatString = timeEdit.Mask.EditMask = DateFormat.Format(fieldType); timeEdit.DisplayFormat.FormatString = timeEdit.EditFormat.FormatString = timeEdit.Mask.EditMask = DateFormat.Format(fieldType);
timeEdit.DisplayFormat.FormatType = timeEdit.EditFormat.FormatType = DevExpress.Utils.FormatType.Custom; timeEdit.DisplayFormat.FormatType = timeEdit.EditFormat.FormatType = DevExpress.Utils.FormatType.Custom;
timeEdit.ParseEditValue += delegate(object sender, ConvertEditValueEventArgs e)
{
// SQL Server 的 time 字段在 DataTable 中是 TimeSpanTimeEdit 输入后返回 DateTime。
// 只转换 TimeSpan 绑定列,不改变原有 DateTime 类型列的行为。
if (gridColumn.ColumnType != typeof(TimeSpan) || e.Value == null || e.Value == DBNull.Value)
{
return;
}
if (e.Value is DateTime)
{
e.Value = ((DateTime)e.Value).TimeOfDay;
e.Handled = true;
return;
}
TimeSpan timeValue;
if (!(e.Value is TimeSpan) && TimeSpan.TryParse(e.Value.ToString(), out timeValue))
{
e.Value = timeValue;
e.Handled = true;
}
};
@@ -4280,6 +4308,8 @@ namespace Lskj.Control
memoEdit.ShowIcon = false; memoEdit.ShowIcon = false;
if (!gridColumn.OptionsColumn.AllowEdit) if (!gridColumn.OptionsColumn.AllowEdit)
{ {
// AllowEdit 需要保持为 true 才能打开备注弹窗,ReadOnly 保存真实的禁编状态。
gridColumn.OptionsColumn.ReadOnly = true;
gridColumn.OptionsColumn.AllowEdit = true; gridColumn.OptionsColumn.AllowEdit = true;
//设置只读 //设置只读
memoEdit.ReadOnly = true; memoEdit.ReadOnly = true;
@@ -5506,6 +5536,9 @@ namespace Lskj.Control
modelLookUp.Tag = model; modelLookUp.Tag = model;
RepositoryItemCheckedComboBoxEdit btnEdit = new RepositoryItemCheckedComboBoxEdit(); RepositoryItemCheckedComboBoxEdit btnEdit = new RepositoryItemCheckedComboBoxEdit();
btnEdit.ShowDropDown = ShowDropDown.Never;
btnEdit.NullText = ""; btnEdit.NullText = "";
btnEdit.PopupBorderStyle = PopupBorderStyles.Flat; btnEdit.PopupBorderStyle = PopupBorderStyles.Flat;
btnEdit.AllowNullInput = DefaultBoolean.False; btnEdit.AllowNullInput = DefaultBoolean.False;
@@ -5550,6 +5583,9 @@ namespace Lskj.Control
} }
RepositoryItemCheckedComboBoxEdit btnEdit = new RepositoryItemCheckedComboBoxEdit(); RepositoryItemCheckedComboBoxEdit btnEdit = new RepositoryItemCheckedComboBoxEdit();
btnEdit.ShowDropDown = ShowDropDown.Never;
btnEdit.NullText = ""; btnEdit.NullText = "";
btnEdit.PopupBorderStyle = PopupBorderStyles.Flat; btnEdit.PopupBorderStyle = PopupBorderStyles.Flat;
btnEdit.AllowNullInput = DefaultBoolean.False; btnEdit.AllowNullInput = DefaultBoolean.False;
@@ -12,10 +12,15 @@ using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo; using DevExpress.XtraGrid.Views.Grid.ViewInfo;
// Token: 0x02000003 RID: 3 // Token: 0x02000003 RID: 3
public class AmountCellRender public class AmountCellRender : IDisposable
{ {
public AmountCellRender(GridView gridView_0) public AmountCellRender(GridView gridView_0)
{ {
if (gridView_0 == null)
{
throw new ArgumentNullException("gridView_0");
}
Class5.gBkiB4AzUqwkh(); Class5.gBkiB4AzUqwkh();
this.colorGray = Color.FromArgb(189, 185, 185); this.colorGray = Color.FromArgb(189, 185, 185);
this.colorGreen = Color.Green; this.colorGreen = Color.Green;
@@ -25,23 +30,58 @@ public class AmountCellRender
this.dictionary_0 = new Dictionary<string, Class2>(); this.dictionary_0 = new Dictionary<string, Class2>();
this.list_0 = new List<GridColumn>(); this.list_0 = new List<GridColumn>();
this.object_0 = gridView_0; this.object_0 = gridView_0;
this.gridControl_0 = this.object_0.GridControl;
this.object_0.CustomDrawCell += this.object_0_CustomDrawCell; this.object_0.CustomDrawCell += this.object_0_CustomDrawCell;
this.object_0.CustomDrawColumnHeader += this.object_0_CustomDrawColumnHeader; this.object_0.CustomDrawColumnHeader += this.object_0_CustomDrawColumnHeader;
this.object_0.CustomDrawFooterCell += this.object_0_CustomDrawFooterCell; this.object_0.CustomDrawFooterCell += this.object_0_CustomDrawFooterCell;
this.object_0.GridControl.Paint += this.method_0; if (this.gridControl_0 != null)
{
this.gridControl_0.Paint += this.method_0;
}
} }
private void method_0(object sender, PaintEventArgs e) private void method_0(object sender, PaintEventArgs e)
{ {
BaseViewInfo viewInfo = ((sender as GridControl).FocusedView as GridView).GetViewInfo(); if (this.disposed || this.list_0.Count == 0)
{
return;
}
GridControl gridControl = sender as GridControl;
if (gridControl == null || gridControl.IsDisposed || gridControl.Disposing)
{
return;
}
GridView gridView = gridControl.FocusedView as GridView;
if (gridView == null)
{
return;
}
GridViewInfo gridViewInfo = gridView.GetViewInfo() as GridViewInfo;
if (gridViewInfo == null || gridViewInfo.ColumnsInfo == null)
{
return;
}
foreach (GridColumn gridColumn in this.list_0) foreach (GridColumn gridColumn in this.list_0)
{ {
Class2 @class = this.dictionary_0[gridColumn.Name]; Class2 @class;
if (gridColumn == null ||
!this.dictionary_0.TryGetValue(gridColumn.Name, out @class) ||
@class == null)
{
continue;
}
if (@class.IsCountinuousCell()) if (@class.IsCountinuousCell())
{ {
GridViewInfo gridViewInfo = viewInfo as GridViewInfo;
GridColumnInfoArgs gridColumnInfoArgs = gridViewInfo.ColumnsInfo[gridColumn]; GridColumnInfoArgs gridColumnInfoArgs = gridViewInfo.ColumnsInfo[gridColumn];
if (gridColumnInfoArgs == null) return; if (gridColumnInfoArgs == null)
{
continue;
}
int num = 0; int num = 0;
int int_; int int_;
if (@class.method_4()) if (@class.method_4())
@@ -82,10 +122,16 @@ public class AmountCellRender
private void object_0_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e) private void object_0_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
{ {
if (this.dictionary_0.ContainsKey(e.Column.Name)) if (this.disposed || e.Column == null)
{
return;
}
Class2 @class;
if (this.dictionary_0.TryGetValue(e.Column.Name, out @class) &&
@class != null)
{ {
e.DisplayText = ""; e.DisplayText = "";
Class2 @class = this.dictionary_0[e.Column.Name];
Rectangle bounds = e.Bounds; Rectangle bounds = e.Bounds;
Rectangle rectangle_ = bounds; Rectangle rectangle_ = bounds;
Graphics graphics = e.Graphics; Graphics graphics = e.Graphics;
@@ -98,14 +144,20 @@ public class AmountCellRender
private void object_0_CustomDrawFooterCell(object sender, FooterCellCustomDrawEventArgs e) private void object_0_CustomDrawFooterCell(object sender, FooterCellCustomDrawEventArgs e)
{ {
if (this.dictionary_0.ContainsKey(e.Column.Name)) if (this.disposed || e.Column == null)
{
return;
}
Class2 @class;
if (this.dictionary_0.TryGetValue(e.Column.Name, out @class) &&
@class != null)
{ {
Class2 @class = this.dictionary_0[e.Column.Name];
if (@class.method_8()) if (@class.method_8())
{ {
e.Info.DisplayText = ""; e.Info.DisplayText = "";
Rectangle bounds = e.Bounds; Rectangle bounds = e.Bounds;
@class.method_17(bounds, e.Graphics, e.Appearance.Font, e.Info.Value.ToString()); @class.method_17(bounds, e.Graphics, e.Appearance.Font, Convert.ToString(e.Info.Value));
e.Handled = true; e.Handled = true;
} }
} }
@@ -113,13 +165,15 @@ public class AmountCellRender
private void object_0_CustomDrawColumnHeader(object sender, ColumnHeaderCustomDrawEventArgs e) private void object_0_CustomDrawColumnHeader(object sender, ColumnHeaderCustomDrawEventArgs e)
{ {
if (e.Column == null) if (this.disposed || e.Column == null)
{ {
return; return;
} }
if (this.dictionary_0.ContainsKey(e.Column.Name))
Class2 @class;
if (this.dictionary_0.TryGetValue(e.Column.Name, out @class) &&
@class != null)
{ {
Class2 @class = this.dictionary_0[e.Column.Name];
if (@class.method_6()) if (@class.method_6())
{ {
e.Column.Caption = ""; e.Column.Caption = "";
@@ -204,14 +258,44 @@ public class AmountCellRender
public void RemoveAmountColumn(GridColumn gridColumn_0) public void RemoveAmountColumn(GridColumn gridColumn_0)
{ {
if (this.dictionary_0.ContainsKey(gridColumn_0.Name)) if (gridColumn_0 != null && this.dictionary_0.ContainsKey(gridColumn_0.Name))
{ {
this.dictionary_0.Remove(gridColumn_0.Name); this.dictionary_0.Remove(gridColumn_0.Name);
this.list_0.Remove(gridColumn_0); this.list_0.Remove(gridColumn_0);
} }
} }
public void Dispose()
{
if (this.disposed)
{
return;
}
this.disposed = true;
GridView gridView = this.object_0;
GridControl gridControl = this.gridControl_0;
this.object_0 = null;
this.gridControl_0 = null;
if (gridView != null)
{
gridView.CustomDrawCell -= this.object_0_CustomDrawCell;
gridView.CustomDrawColumnHeader -= this.object_0_CustomDrawColumnHeader;
gridView.CustomDrawFooterCell -= this.object_0_CustomDrawFooterCell;
}
if (gridControl != null)
{
gridControl.Paint -= this.method_0;
}
this.dictionary_0.Clear();
this.list_0.Clear();
}
private GridView object_0; private GridView object_0;
private GridControl gridControl_0;
private bool disposed;
private Color colorGray; private Color colorGray;
private Color colorGreen; private Color colorGreen;
+9 -3
View File
@@ -255,7 +255,10 @@ public class Class2
if (color != Color.Empty) if (color != Color.Empty)
{ {
Rectangle rect = new Rectangle(rectangle_0.Left + i - 2, int_2, int_1, int_3); Rectangle rect = new Rectangle(rectangle_0.Left + i - 2, int_2, int_1, int_3);
graphics_0.FillRectangle(new SolidBrush(color), rect); using (SolidBrush solidBrush = new SolidBrush(color))
{
graphics_0.FillRectangle(solidBrush, rect);
}
} }
} }
else else
@@ -265,9 +268,12 @@ public class Class2
num++; num++;
} }
Rectangle rect2 = new Rectangle(rectangle_0.Left - 1, int_2, int_1 + 1, int_3); Rectangle rect2 = new Rectangle(rectangle_0.Left - 1, int_2, int_1 + 1, int_3);
graphics_0.FillRectangle(new SolidBrush(Color.FromArgb(161, 157, 157)), rect2);
Rectangle rect3 = new Rectangle(rectangle_0.Left + rectangle_0.Width - 1, int_2, int_1 + 1, int_3); Rectangle rect3 = new Rectangle(rectangle_0.Left + rectangle_0.Width - 1, int_2, int_1 + 1, int_3);
graphics_0.FillRectangle(new SolidBrush(Color.FromArgb(161, 157, 157)), rect3); using (SolidBrush solidBrush = new SolidBrush(Color.FromArgb(161, 157, 157)))
{
graphics_0.FillRectangle(solidBrush, rect2);
graphics_0.FillRectangle(solidBrush, rect3);
}
} }
// Token: 0x06000028 RID: 40 RVA: 0x00002CC8 File Offset: 0x00000EC8 // Token: 0x06000028 RID: 40 RVA: 0x00002CC8 File Offset: 0x00000EC8
+252
View File
@@ -0,0 +1,252 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraEditors;
namespace Lskj.Control
{
/// <summary>
/// 带标题的时间输入控件,使用上下按钮调整时间。
/// </summary>
public class LabelTimeEdit : BaseUserControl
{
private readonly Panel plLeft;
private readonly Panel plRight;
private readonly Label lblText;
private readonly TimeEdit txtEdit;
private string formatString = "HH:mm:ss";
public LabelTimeEdit()
{
plLeft = new Panel();
plRight = new Panel();
lblText = new Label();
txtEdit = new TimeEdit();
SuspendLayout();
plLeft.SuspendLayout();
plRight.SuspendLayout();
((System.ComponentModel.ISupportInitialize)txtEdit.Properties).BeginInit();
plLeft.BackColor = Color.Transparent;
plLeft.Controls.Add(lblText);
plLeft.Dock = DockStyle.Left;
plLeft.Size = new Size(40, 21);
lblText.AutoSize = true;
lblText.Location = new Point(5, 4);
lblText.Text = "名称";
plRight.Controls.Add(txtEdit);
plRight.Dock = DockStyle.Fill;
plRight.Location = new Point(40, 0);
txtEdit.Dock = DockStyle.Fill;
txtEdit.EditValue = null;
txtEdit.Properties.Buttons.Clear();
txtEdit.Properties.Buttons.Add(new DevExpress.XtraEditors.Controls.EditorButton(
DevExpress.XtraEditors.Controls.ButtonPredefines.Combo));
txtEdit.Properties.TimeEditStyle = DevExpress.XtraEditors.Repository.TimeEditStyle.SpinButtons;
AutoScaleMode = AutoScaleMode.None;
BackColor = Color.Transparent;
Controls.Add(plRight);
Controls.Add(plLeft);
Size = new Size(162, 21);
((System.ComponentModel.ISupportInitialize)txtEdit.Properties).EndInit();
plRight.ResumeLayout(false);
plLeft.ResumeLayout(false);
plLeft.PerformLayout();
ResumeLayout(false);
}
/// <summary>
/// 时间编辑器。
/// </summary>
public TimeEdit TextEdit
{
get { return txtEdit; }
}
public override string LabelText
{
get { return lblText.Text; }
set
{
lblText.Text = value;
if (FontSize > 0)
{
plLeft.AutoSize = false;
lblText.AutoSize = false;
lblText.Dock = DockStyle.Fill;
lblText.Location = new Point(0, 0);
lblText.TextAlign = ContentAlignment.MiddleLeft;
txtEdit.Properties.AutoHeight = false;
plLeft.Width = value.Length * GetCharWidth();
GetCharWidthMultilingual(lblText, lblText.Text, plLeft);
}
else
{
plLeft.Width = lblText.Width + PaddingLeft;
}
}
}
public override float FontSize
{
get { return base.FontSize; }
set
{
base.FontSize = value;
if (value > 0)
{
lblText.Font = new Font(lblText.Font.FontFamily, value);
txtEdit.Font = new Font(txtEdit.Font.FontFamily, value);
}
}
}
public override string EditText
{
get { return txtEdit.EditValue == null ? string.Empty : txtEdit.Text; }
set
{
TimeSpan timeValue;
txtEdit.EditValue = TryGetTime(value, out timeValue)
? (object)DateTime.Today.Add(timeValue)
: null;
}
}
public override string NullText
{
get { return txtEdit.Properties.NullValuePrompt; }
set
{
if (!string.IsNullOrEmpty(value))
{
txtEdit.Properties.NullValuePromptShowForEmptyValue = true;
txtEdit.Properties.NullValuePrompt = value;
}
base.NullText = value;
}
}
public override bool ReadOnly
{
get { return base.ReadOnly; }
set
{
base.ReadOnly = value;
txtEdit.Properties.ReadOnly = value;
txtEdit.Enabled = !value;
lblText.ForeColor = value ? ReadOnlyLabelForceColor : Required ? RequiredLabelForceColor : DefaultLabelForceColor;
}
}
public override bool Required
{
get { return base.Required; }
set
{
base.Required = value;
if (value)
{
lblText.ForeColor = RequiredLabelForceColor;
}
}
}
public override Color BackgroundColor
{
get { return txtEdit.Properties.Appearance.BackColor; }
set { txtEdit.Properties.Appearance.BackColor = value; }
}
public override Color ForeColor
{
get { return txtEdit.Properties.Appearance.ForeColor; }
set { txtEdit.Properties.Appearance.ForeColor = value; }
}
public override bool ContentBold
{
get { return txtEdit.Properties.Appearance.Font.Bold; }
set
{
Font oldFont = txtEdit.Properties.Appearance.Font;
txtEdit.Properties.Appearance.Font = new Font(oldFont.FontFamily, oldFont.Size, value ? FontStyle.Bold : FontStyle.Regular);
}
}
/// <summary>
/// 设置时间的显示和输入格式。
/// </summary>
public void TimeFormat(string value)
{
if (string.IsNullOrWhiteSpace(value))
{
return;
}
formatString = value;
txtEdit.Properties.DisplayFormat.FormatString = value;
txtEdit.Properties.EditFormat.FormatString = value;
txtEdit.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
txtEdit.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Custom;
txtEdit.Properties.Mask.EditMask = value;
txtEdit.Properties.Mask.UseMaskAsDisplayFormat = true;
txtEdit.Properties.TimeFormat = value.IndexOf("ss", StringComparison.OrdinalIgnoreCase) >= 0
? DevExpress.XtraEditors.Controls.TimeFormat.HourMinSec
: DevExpress.XtraEditors.Controls.TimeFormat.HourMin;
}
/// <summary>
/// 按控件显示精度比较当前值和原值,避免 DateTime/TimeSpan 字符串格式差异造成误判。
/// </summary>
public bool IsSameTime(string value)
{
TimeSpan oldTime;
TimeSpan currentTime;
bool hasOldTime = TryGetTime(value, out oldTime);
bool hasCurrentTime = TryGetTime(EditText, out currentTime);
if (!hasOldTime || !hasCurrentTime)
{
return !hasOldTime && !hasCurrentTime;
}
if (formatString.IndexOf("ss", StringComparison.OrdinalIgnoreCase) >= 0)
{
return oldTime.Hours == currentTime.Hours &&
oldTime.Minutes == currentTime.Minutes &&
oldTime.Seconds == currentTime.Seconds;
}
return oldTime.Hours == currentTime.Hours && oldTime.Minutes == currentTime.Minutes;
}
private static bool TryGetTime(string value, out TimeSpan timeValue)
{
timeValue = TimeSpan.Zero;
if (string.IsNullOrWhiteSpace(value))
{
return false;
}
if (TimeSpan.TryParse(value, out timeValue))
{
return true;
}
DateTime dateValue;
if (DateTime.TryParse(value, out dateValue))
{
timeValue = dateValue.TimeOfDay;
return true;
}
return false;
}
}
}
@@ -928,6 +928,7 @@
<DependentUpon>LabelWeigh.cs</DependentUpon> <DependentUpon>LabelWeigh.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Model\AttachHelper.cs" /> <Compile Include="Model\AttachHelper.cs" />
<Compile Include="Model\AltButtonShortcutManager.cs" />
<Compile Include="AuditPanelEx.cs"> <Compile Include="AuditPanelEx.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
@@ -1219,6 +1220,9 @@
<Compile Include="LabelDateEdit.Designer.cs"> <Compile Include="LabelDateEdit.Designer.cs">
<DependentUpon>LabelDateEdit.cs</DependentUpon> <DependentUpon>LabelDateEdit.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="LabelTimeEdit.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="LabelImageEdit.cs"> <Compile Include="LabelImageEdit.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
@@ -0,0 +1,122 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using DevExpress.XtraEditors;
namespace Lskj.Control.Model
{
/// <summary>
/// 将按钮原有的 &amp; 助记键改为必须按 Alt 才能触发的快捷键。
/// </summary>
public sealed class AltButtonShortcutManager
{
private sealed class ShortcutItem
{
public SimpleButton Button;
public Keys Key;
}
private readonly List<ShortcutItem> mShortcutItems =
new List<ShortcutItem>();
private bool mUpdatingText;
/// <summary>
/// 注册按钮快捷键,并移除标题中的 &amp;,保持界面显示为“按钮名(X)”。
/// </summary>
public void Register(SimpleButton button, Keys defaultKey)
{
if (button == null)
{
return;
}
ShortcutItem item = mShortcutItems.Find(
shortcut => ReferenceEquals(shortcut.Button, button));
if (item == null)
{
item = new ShortcutItem { Button = button, Key = defaultKey };
mShortcutItems.Add(item);
button.TextChanged += OnButtonTextChanged;
}
UpdateShortcut(item, defaultKey);
}
/// <summary>
/// 只响应 Alt+原助记键;未按 Alt、同时按下其他修饰键时均不处理。
/// </summary>
public bool ProcessKey(Keys keyData)
{
if ((keyData & Keys.Modifiers) != Keys.Alt)
{
return false;
}
Keys keyCode = keyData & Keys.KeyCode;
foreach (ShortcutItem item in mShortcutItems)
{
SimpleButton button = item.Button;
if (item.Key == keyCode && button != null &&
!button.IsDisposed && button.Visible && button.Enabled)
{
button.PerformClick();
return true;
}
}
return false;
}
private void OnButtonTextChanged(object sender, EventArgs e)
{
if (mUpdatingText)
{
return;
}
SimpleButton button = sender as SimpleButton;
ShortcutItem item = mShortcutItems.Find(
shortcut => ReferenceEquals(shortcut.Button, button));
if (item != null)
{
UpdateShortcut(item, item.Key);
}
}
private void UpdateShortcut(ShortcutItem item, Keys defaultKey)
{
string text = item.Button.Text ?? string.Empty;
int mnemonicIndex = FindMnemonicIndex(text);
if (mnemonicIndex >= 0)
{
item.Key = (Keys)char.ToUpperInvariant(text[mnemonicIndex + 1]);
mUpdatingText = true;
try
{
item.Button.Text = text.Remove(mnemonicIndex, 1);
}
finally
{
mUpdatingText = false;
}
}
else
{
item.Key = defaultKey;
}
}
private static int FindMnemonicIndex(string text)
{
for (int index = 0; index < text.Length - 1; index++)
{
if (text[index] == '&' && char.IsLetterOrDigit(text[index + 1]))
{
return index;
}
}
return -1;
}
}
}
+1 -1
View File
@@ -161,7 +161,7 @@ namespace Lskj.Control.Model
/// </summary> /// </summary>
public const int LabComboxCheckListText = 19; public const int LabComboxCheckListText = 19;
/// <summary> /// <summary>
/// Memo控件 /// Memo控件 (备注框A
/// </summary> /// </summary>
public const int LabMemoEdit = 20; public const int LabMemoEdit = 20;
/// <summary> /// <summary>
+1 -1
View File
@@ -289,7 +289,6 @@ namespace Lskj.Control.Model
DragHander.Clear(); DragHander.Clear();
} }
} }
/// <summary> /// <summary>
/// <para>说明:获取表格选中行数据</para> /// <para>说明:获取表格选中行数据</para>
/// <para>创建人:龚宇超</para> /// <para>创建人:龚宇超</para>
@@ -552,6 +551,7 @@ namespace Lskj.Control.Model
} }
} }
} }
/// <summary> /// <summary>
/// 焦点行改变时 /// 焦点行改变时
/// </summary> /// </summary>
@@ -21,6 +21,7 @@ namespace Lskj.Control.Model
public class GridViewMenuStrip : BaseRightMenu public class GridViewMenuStrip : BaseRightMenu
{ {
private int[] _oldSelectRows; private int[] _oldSelectRows;
private HashSet<object> _oldSelectPrimaryValues;
private DataRow _oldDataRow; private DataRow _oldDataRow;
private int _oldRowHandler; private int _oldRowHandler;
private GridView _gridView; private GridView _gridView;
@@ -231,8 +232,82 @@ namespace Lskj.Control.Model
this._oldSelectRows = this._gridView.GetSelectedRows(); this._oldSelectRows = this._gridView.GetSelectedRows();
this._oldDataRow = this._gridView.GetFocusedDataRow(); this._oldDataRow = this._gridView.GetFocusedDataRow();
this._oldRowHandler = this._gridView.FocusedRowHandle; this._oldRowHandler = this._gridView.FocusedRowHandle;
// 复选框模式下保存选中行的主键值,避免刷新后行号对应到其他数据。
this._oldSelectPrimaryValues = null;
string primaryKey = this.GridControlObj == null ? string.Empty : this.GridControlObj.MultiplePrimary;
bool isCheckBoxRowSelect = this._gridView.OptionsSelection.MultiSelect == true
&& this._gridView.OptionsSelection.EnableAppearanceFocusedCell == false
&& this._gridView.OptionsSelection.MultiSelectMode == GridMultiSelectMode.CheckBoxRowSelect;
if (isCheckBoxRowSelect && !string.IsNullOrWhiteSpace(primaryKey) && this._oldSelectRows != null)
{
foreach (int rowHandle in this._oldSelectRows)
{
DataRow row = this._gridView.GetDataRow(rowHandle);
if (row == null || !row.Table.Columns.Contains(primaryKey) || row.IsNull(primaryKey))
continue;
object primaryValue = row[primaryKey];
if (string.IsNullOrWhiteSpace(primaryValue + ""))
continue;
if (this._oldSelectPrimaryValues == null)
this._oldSelectPrimaryValues = new HashSet<object>();
this._oldSelectPrimaryValues.Add(primaryValue);
}
}
} }
protected override void MenuStripClickAfter(ToolStripMenuItem item, GridRightMenuModel model) protected override void MenuStripClickAfter(ToolStripMenuItem item, GridRightMenuModel model)
{
string ParmaryKey = string.Empty;
if(this.GridControlObj!=null) ParmaryKey = GridControlObj.MultiplePrimary;
bool isCheckBoxRowSelect = this._gridView.OptionsSelection.MultiSelect == true&& this._gridView.OptionsSelection.EnableAppearanceFocusedCell == false && this._gridView.OptionsSelection.MultiSelectMode == GridMultiSelectMode.CheckBoxRowSelect;
DataTable currentDataTable = this.GridControlObj == null ? null : this.GridControlObj.GridControl.DataSourceTable();
if (isCheckBoxRowSelect&& !string.IsNullOrWhiteSpace(ParmaryKey) && this._oldSelectPrimaryValues != null&& this._oldSelectPrimaryValues.Count > 0&& currentDataTable != null&& currentDataTable.Columns.Contains(ParmaryKey))
{
//2026-08-17添加,如果是复选框模式,并且有主键,右键后选中之前的行用主键值判断
// 只恢复刷新后仍存在的主键,已删除的数据不再按原行号选中。
this._gridView.ClearSelection();
if (!model.RefreshCheckState)
{
DataColumn[] tablePrimaryKey = currentDataTable.PrimaryKey;
bool canFindByPrimaryKey = this.GridControlObj.GridControl.DataSource is DataTable
&& tablePrimaryKey != null
&& tablePrimaryKey.Length == 1
&& tablePrimaryKey[0].ColumnName.Equals(ParmaryKey, StringComparison.OrdinalIgnoreCase);
if (canFindByPrimaryKey)
{
// DataTable设置了PrimaryKey时,使用其内部索引直接查找。
foreach (object primaryValue in this._oldSelectPrimaryValues)
{
DataRow row = currentDataTable.Rows.Find(primaryValue);
if (row == null)
continue;
int rowHandle = this._gridView.GetRowHandle(currentDataTable.Rows.IndexOf(row));
if (rowHandle >= 0)
this._gridView.SelectRow(rowHandle);
}
}
else
{
// MultiplePrimary只是字段配置时没有数据索引,单次扫描比逐个LocateByValue更稳定。
HashSet<object> remainingPrimaryValues = new HashSet<object>(this._oldSelectPrimaryValues);
for (int rowHandle = 0; rowHandle < this._gridView.DataRowCount && remainingPrimaryValues.Count > 0; rowHandle++)
{
DataRow row = this._gridView.GetDataRow(rowHandle);
if (row == null || !row.Table.Columns.Contains(ParmaryKey) || row.IsNull(ParmaryKey))
continue;
if (remainingPrimaryValues.Remove(row[ParmaryKey]))
this._gridView.SelectRow(rowHandle);
}
}
}
}
else
{ {
DataTable dataTable = this.GridControlObj.GridView.GetGridViewFilteredAndSortedDataToDataTable() as DataTable; DataTable dataTable = this.GridControlObj.GridView.GetGridViewFilteredAndSortedDataToDataTable() as DataTable;
List<DataRow> rows = new List<DataRow>() { this._oldDataRow }; List<DataRow> rows = new List<DataRow>() { this._oldDataRow };
@@ -268,6 +343,7 @@ namespace Lskj.Control.Model
this._gridView.SelectRowHandler(this._oldRowHandler); this._gridView.SelectRowHandler(this._oldRowHandler);
} }
} }
}
protected override List<string> HandleRightMenuParams(List<string> paramList, DataRow rowData, DataRow[] rowDatas = null, int actionType = 0) protected override List<string> HandleRightMenuParams(List<string> paramList, DataRow rowData, DataRow[] rowDatas = null, int actionType = 0)
{ {
List<string> handleParamList = base.HandleRightMenuParams(paramList, rowData, rowDatas, actionType); List<string> handleParamList = base.HandleRightMenuParams(paramList, rowData, rowDatas, actionType);
+22 -5
View File
@@ -2095,8 +2095,6 @@ namespace Lskj.Control.Model
case ControlType.LabDate: case ControlType.LabDate:
case ControlType.LabDateTime: case ControlType.LabDateTime:
case ControlType.LabDateTimeShort: case ControlType.LabDateTimeShort:
case ControlType.LabTime:
case ControlType.LabShortTime:
// 日期控件 // 日期控件
LabelDateEdit dateEdit = ctr as LabelDateEdit; LabelDateEdit dateEdit = ctr as LabelDateEdit;
if (string.IsNullOrWhiteSpace(dateEdit.FormatType)) if (string.IsNullOrWhiteSpace(dateEdit.FormatType))
@@ -2109,6 +2107,12 @@ namespace Lskj.Control.Model
} }
//value = dateEdit.TextEdit.EditValue == null ? dateEdit.EditText : dateEdit.TextEdit.EditValue.ToString(); //value = dateEdit.TextEdit.EditValue == null ? dateEdit.EditText : dateEdit.TextEdit.EditValue.ToString();
break; break;
case ControlType.LabTime:
case ControlType.LabShortTime:
// 时间控件只返回时分秒部分,不附带日期。
LabelTimeEdit timeEdit = ctr as LabelTimeEdit;
value = timeEdit == null ? string.Empty : timeEdit.EditText;
break;
case ControlType.LabDateHalfDay: case ControlType.LabDateHalfDay:
// 日期半天控件 // 日期半天控件
LabelDateHalfDayEdit dateHalfDayEdit = ctr as LabelDateHalfDayEdit; LabelDateHalfDayEdit dateHalfDayEdit = ctr as LabelDateHalfDayEdit;
@@ -4519,11 +4523,20 @@ namespace Lskj.Control.Model
Font mRowFont = new Font("Microsoft YaHei UI", 12); Font mRowFont = new Font("Microsoft YaHei UI", 12);
switch (model.FieldType) switch (model.FieldType)
{ {
case ControlType.LabTime:
case ControlType.LabShortTime:
// 时间控件使用 TimeEdit,避免 DateEdit 显示日期日历。
LabelTimeEdit timeEdit = new LabelTimeEdit();
timeEdit.TextEdit.KeyDown += new KeyEventHandler(OnTextEditKeyDown);
timeEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
// 时间类型固定使用时分或时分秒,避免旧的日期格式配置覆盖为年月日。
timeEdit.TimeFormat(DateFormat.Format(model.FieldType));
if (!isLoadBorder) timeEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
baseControl = timeEdit;
break;
case ControlType.LabDate: case ControlType.LabDate:
case ControlType.LabDateTime: case ControlType.LabDateTime:
case ControlType.LabDateTimeShort: case ControlType.LabDateTimeShort:
case ControlType.LabTime:
case ControlType.LabShortTime:
case ControlType.LabShortDate: case ControlType.LabShortDate:
// 日期控件 // 日期控件
LabelDateEdit dateEdit = new LabelDateEdit(); LabelDateEdit dateEdit = new LabelDateEdit();
@@ -6699,6 +6712,10 @@ namespace Lskj.Control.Model
LabelDateEdit dateEdit = controlObj as LabelDateEdit; LabelDateEdit dateEdit = controlObj as LabelDateEdit;
value = dateEdit.TextEdit.EditValue == null ? dateEdit.EditText : dateEdit.TextEdit.DateTime.ToString("yyyy-MM-dd"); value = dateEdit.TextEdit.EditValue == null ? dateEdit.EditText : dateEdit.TextEdit.DateTime.ToString("yyyy-MM-dd");
} }
else if (controlObj is LabelTimeEdit)
{
value = ((LabelTimeEdit)controlObj).EditText;
}
else if (controlObj is LabelCheckEdit) else if (controlObj is LabelCheckEdit)
{ {
LabelCheckEdit checkEdit = controlObj as LabelCheckEdit; LabelCheckEdit checkEdit = controlObj as LabelCheckEdit;
@@ -6892,7 +6909,7 @@ namespace Lskj.Control.Model
{ {
if (Model != null && Model.DataCaches != null) if (Model != null && Model.DataCaches != null)
{ {
Model.DataCaches.Remove(this); Model.DataCaches.RemoveCache(this);
} }
} }
catch catch
+1 -1
View File
@@ -261,7 +261,7 @@ namespace Lskj.Control
{ {
if (Model != null && Model.DataCaches != null) if (Model != null && Model.DataCaches != null)
{ {
Model.DataCaches.Remove(this); Model.DataCaches.RemoveCache(this);
} }
} }
catch catch
+9 -2
View File
@@ -193,7 +193,7 @@ namespace Lskj.Control
{ {
if (Model != null && Model.DataCaches != null) if (Model != null && Model.DataCaches != null)
{ {
Model.DataCaches.Remove(this); Model.DataCaches.RemoveCache(this);
} }
} }
catch catch
@@ -314,11 +314,18 @@ namespace Lskj.Control
return; return;
} }
mDetailPageCachesPrepared = true;
Task<DynamicModel> dynamicModelTask = Task<DynamicModel> dynamicModelTask =
cachesDic.GetTask<DynamicModel>(this, "DynamicModel"); cachesDic.GetTask<DynamicModel>(this, "DynamicModel");
Task<List<GridDetailModel>> detailsTask = Task<List<GridDetailModel>> detailsTask =
cachesDic.GetTask<List<GridDetailModel>>(this, "Details"); cachesDic.GetTask<List<GridDetailModel>>(this, "Details");
// 未启用预加载缓存时,InitializePages 会按原有同步方式创建明细页签。
if (dynamicModelTask == null || detailsTask == null)
{
return;
}
mDetailPageCachesPrepared = true;
cachesDic.AddTask(tcButtom, "DynamicModel", dynamicModelTask); cachesDic.AddTask(tcButtom, "DynamicModel", dynamicModelTask);
cachesDic.AddTask(tcButtom, "Details", detailsTask); cachesDic.AddTask(tcButtom, "Details", detailsTask);
this.tcButtom.GetDataCaches(cachesDic); this.tcButtom.GetDataCaches(cachesDic);
+8 -8
View File
@@ -343,7 +343,7 @@
this.btnFixSearch.Name = "btnFixSearch"; this.btnFixSearch.Name = "btnFixSearch";
this.btnFixSearch.Size = new System.Drawing.Size(63, 24); this.btnFixSearch.Size = new System.Drawing.Size(63, 24);
this.btnFixSearch.TabIndex = 33; this.btnFixSearch.TabIndex = 33;
this.btnFixSearch.Text = "查询(&Q)"; this.btnFixSearch.Text = "查询(Q)";
// //
// txtFixKey // txtFixKey
// //
@@ -439,7 +439,7 @@
this.btnSave.Name = "btnSave"; this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(72, 26); this.btnSave.Size = new System.Drawing.Size(72, 26);
this.btnSave.TabIndex = 37; this.btnSave.TabIndex = 37;
this.btnSave.Text = "保存(&S)"; this.btnSave.Text = "保存(S)";
this.btnSave.Click += new System.EventHandler(this.OnSaveClick); this.btnSave.Click += new System.EventHandler(this.OnSaveClick);
// //
// btnUpdate // btnUpdate
@@ -451,7 +451,7 @@
this.btnUpdate.Name = "btnUpdate"; this.btnUpdate.Name = "btnUpdate";
this.btnUpdate.Size = new System.Drawing.Size(72, 26); this.btnUpdate.Size = new System.Drawing.Size(72, 26);
this.btnUpdate.TabIndex = 38; this.btnUpdate.TabIndex = 38;
this.btnUpdate.Text = "修改(&U)"; this.btnUpdate.Text = "修改(U)";
this.btnUpdate.Visible = false; this.btnUpdate.Visible = false;
this.btnUpdate.Click += new System.EventHandler(this.OnUpdateClick); this.btnUpdate.Click += new System.EventHandler(this.OnUpdateClick);
// //
@@ -464,7 +464,7 @@
this.btnPrint.Name = "btnPrint"; this.btnPrint.Name = "btnPrint";
this.btnPrint.Size = new System.Drawing.Size(72, 26); this.btnPrint.Size = new System.Drawing.Size(72, 26);
this.btnPrint.TabIndex = 37; this.btnPrint.TabIndex = 37;
this.btnPrint.Text = "打印(&P)"; this.btnPrint.Text = "打印(P)";
this.btnPrint.Visible = false; this.btnPrint.Visible = false;
this.btnPrint.Click += new System.EventHandler(this.OnPrintClick); this.btnPrint.Click += new System.EventHandler(this.OnPrintClick);
// //
@@ -477,7 +477,7 @@
this.btnExport.Name = "btnExport"; this.btnExport.Name = "btnExport";
this.btnExport.Size = new System.Drawing.Size(72, 26); this.btnExport.Size = new System.Drawing.Size(72, 26);
this.btnExport.TabIndex = 37; this.btnExport.TabIndex = 37;
this.btnExport.Text = "导出(&E)"; this.btnExport.Text = "导出(E)";
this.btnExport.Visible = false; this.btnExport.Visible = false;
this.btnExport.Click += new System.EventHandler(this.OnExportClick); this.btnExport.Click += new System.EventHandler(this.OnExportClick);
// //
@@ -490,7 +490,7 @@
this.btnImport.Name = "btnImport"; this.btnImport.Name = "btnImport";
this.btnImport.Size = new System.Drawing.Size(72, 26); this.btnImport.Size = new System.Drawing.Size(72, 26);
this.btnImport.TabIndex = 37; this.btnImport.TabIndex = 37;
this.btnImport.Text = "导入(&I)"; this.btnImport.Text = "导入(I)";
this.btnImport.Visible = false; this.btnImport.Visible = false;
this.btnImport.Click += new System.EventHandler(this.OnImportClick); this.btnImport.Click += new System.EventHandler(this.OnImportClick);
// //
@@ -503,7 +503,7 @@
this.btnDel.Name = "btnDel"; this.btnDel.Name = "btnDel";
this.btnDel.Size = new System.Drawing.Size(72, 26); this.btnDel.Size = new System.Drawing.Size(72, 26);
this.btnDel.TabIndex = 36; this.btnDel.TabIndex = 36;
this.btnDel.Text = "删除(&D)"; this.btnDel.Text = "删除(D)";
this.btnDel.Click += new System.EventHandler(this.OnDelClick); this.btnDel.Click += new System.EventHandler(this.OnDelClick);
// //
// btnAdd // btnAdd
@@ -515,7 +515,7 @@
this.btnAdd.Name = "btnAdd"; this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(72, 26); this.btnAdd.Size = new System.Drawing.Size(72, 26);
this.btnAdd.TabIndex = 35; this.btnAdd.TabIndex = 35;
this.btnAdd.Text = "增加(&A)"; this.btnAdd.Text = "增加(A)";
this.btnAdd.Click += new System.EventHandler(this.OnAddClick); this.btnAdd.Click += new System.EventHandler(this.OnAddClick);
// //
// ModuleGridEx // ModuleGridEx
+58 -23
View File
@@ -53,6 +53,9 @@ namespace Lskj.Control
/// </summary> /// </summary>
public partial class ModuleGridEx : UserControl public partial class ModuleGridEx : UserControl
{ {
private readonly AltButtonShortcutManager mAltButtonShortcuts =
new AltButtonShortcutManager();
#region private property #region private property
/// <summary> /// <summary>
@@ -1044,6 +1047,10 @@ namespace Lskj.Control
this.gcMain.Model = this.Model; this.gcMain.Model = this.Model;
this.gcMain.SysModel = this.SysModel; this.gcMain.SysModel = this.SysModel;
this.gcMain.Dock = DockStyle.Fill; this.gcMain.Dock = DockStyle.Fill;
if (this.SysModel.GridObjIsCheck == 1)//主表加载复选框
{
GridDragGrid.GridAddCheckBox((this.gcMain as BandedGridControlEx).GridView);
}
this.panelControl1.Controls.Add(this.gcMain); this.panelControl1.Controls.Add(this.gcMain);
if (this.SysModel.LoadFilter) (this.gcMain as BandedGridControlEx).GridView.OptionsView.ShowAutoFilterRow = true; if (this.SysModel.LoadFilter) (this.gcMain as BandedGridControlEx).GridView.OptionsView.ShowAutoFilterRow = true;
(this.gcMain as BandedGridControlEx).gridControl.Tag = panel; (this.gcMain as BandedGridControlEx).gridControl.Tag = panel;
@@ -3550,10 +3557,24 @@ namespace Lskj.Control
if (!string.IsNullOrWhiteSpace(this.SysModel.afterimportSql)) if (!string.IsNullOrWhiteSpace(this.SysModel.afterimportSql))
{ {
try
{
WaitForm.ShowForm();
string sql = this.SearchObj.ReplaceControlValue(this.SysModel.afterimportSql); string sql = this.SearchObj.ReplaceControlValue(this.SysModel.afterimportSql);
string newResult = SqlHelper.ExecuteScalar(sql) + ""; string newResult = SqlHelper.ExecuteScalar(sql) + "";
//if (!string.IsNullOrEmpty(newResult)) MessageUtil.Show(newResult); //if (!string.IsNullOrEmpty(newResult)) MessageUtil.Show(newResult);
} }
catch (Exception e)
{
string Message = ErrorMessage.PromptErrorMessage(e);
MessageUtil.Show("基础档案导入后执行sql错误!" + Message);
}
finally
{
WaitForm.HideForm();
}
}
// 刷新数据 // 刷新数据
if (ImportReturnName.Count > 0) if (ImportReturnName.Count > 0)
@@ -3702,10 +3723,30 @@ namespace Lskj.Control
public ModuleGridEx() public ModuleGridEx()
{ {
InitializeComponent(); InitializeComponent();
InitializeAltButtonShortcuts();
this.OperShortMode = true; this.OperShortMode = true;
this.Disposed += OnModuleGridExDisposed; this.Disposed += OnModuleGridExDisposed;
} }
private void InitializeAltButtonShortcuts()
{
mAltButtonShortcuts.Register(btnFixSearch, Keys.Q);
mAltButtonShortcuts.Register(btnSave, Keys.S);
mAltButtonShortcuts.Register(btnUpdate, Keys.U);
mAltButtonShortcuts.Register(btnPrint, Keys.P);
mAltButtonShortcuts.Register(btnExport, Keys.E);
mAltButtonShortcuts.Register(btnImport, Keys.I);
mAltButtonShortcuts.Register(btnDel, Keys.D);
mAltButtonShortcuts.Register(btnAdd, Keys.A);
}
protected override bool ProcessCmdKey(
ref System.Windows.Forms.Message msg, Keys keyData)
{
return mAltButtonShortcuts.ProcessKey(keyData) ||
base.ProcessCmdKey(ref msg, keyData);
}
/// <summary> /// <summary>
/// 清理公共事件和全局右键引用,避免模块关闭后仍保留当前表格。 /// 清理公共事件和全局右键引用,避免模块关闭后仍保留当前表格。
/// </summary> /// </summary>
@@ -3780,7 +3821,7 @@ namespace Lskj.Control
{ {
if (Model != null && Model.DataCaches != null) if (Model != null && Model.DataCaches != null)
{ {
Model.DataCaches.Remove(this); Model.DataCaches.RemoveCache(this);
} }
} }
catch catch
@@ -5291,28 +5332,6 @@ namespace Lskj.Control
if (!gridView.FocusedColumn.FieldName.Equals("RightMenuBtnEdit"))//操作列可点击 if (!gridView.FocusedColumn.FieldName.Equals("RightMenuBtnEdit"))//操作列可点击
{ {
e.Cancel = !btnSave.Enabled; e.Cancel = !btnSave.Enabled;
//如果是备注框,显示编辑框,但不能修改(编辑框弹出和取消编辑冲突,只能改变只读状态后,开始编辑)
if (gridColumnModel != null && gridColumnModel.FieldType == ControlType.LabMemoEdit)
{
RepositoryItemMemoExEdit memoEdit = gridColumn.ColumnEdit as RepositoryItemMemoExEdit;
if (e.Cancel)
{
//设置只读
memoEdit.ReadOnly = true;
//只读状态允许下拉列表
memoEdit.AllowDropDownWhenReadOnly = DevExpress.Utils.DefaultBoolean.True;
//允许编辑(编辑框弹出)
e.Cancel = false;
}
else
{
if (gridColumn.OptionsColumn.AllowEdit && memoEdit.ReadOnly)
{
memoEdit.ReadOnly = false;
}
}
}
} }
if (!string.IsNullOrEmpty(this.SysModel.RowAllowEditCond) && focusedRow != null) if (!string.IsNullOrEmpty(this.SysModel.RowAllowEditCond) && focusedRow != null)
{ {
@@ -5324,6 +5343,22 @@ namespace Lskj.Control
//e.Cancel = !ReplaceHelper.EvalCond(ReplaceHelper.ReplaceRowParam(focusedRow, gridColumnModel.DisableCond)); //e.Cancel = !ReplaceHelper.EvalCond(ReplaceHelper.ReplaceRowParam(focusedRow, gridColumnModel.DisableCond));
e.Cancel = !ValidateCond(gridColumnModel.DisableCond, focusedRow); e.Cancel = !ValidateCond(gridColumnModel.DisableCond, focusedRow);
} }
// 备注框在禁编状态下仍允许打开弹窗查看内容,但不能修改。
if (gridColumnModel != null && gridColumnModel.FieldType == ControlType.LabMemoEdit)
{
RepositoryItemMemoExEdit memoEdit = gridColumn.ColumnEdit as RepositoryItemMemoExEdit;
if (memoEdit != null)
{
bool readOnly = !btnSave.Enabled || e.Cancel || gridColumn.OptionsColumn.ReadOnly;
memoEdit.ReadOnly = readOnly;
if (readOnly)
{
memoEdit.AllowDropDownWhenReadOnly = DevExpress.Utils.DefaultBoolean.True;
e.Cancel = false;
}
}
}
} }
catch (Exception ex) catch (Exception ex)
{ {
+5 -5
View File
@@ -310,7 +310,7 @@ namespace Lskj.Control
this.btnAttach.Size = new System.Drawing.Size(80, 28); this.btnAttach.Size = new System.Drawing.Size(80, 28);
this.btnAttach.TabIndex = 6; this.btnAttach.TabIndex = 6;
this.btnAttach.TabStop = false; this.btnAttach.TabStop = false;
this.btnAttach.Text = "附件管理(&F)"; this.btnAttach.Text = "附件管理(F)";
// //
// btnUpdate // btnUpdate
// //
@@ -321,7 +321,7 @@ namespace Lskj.Control
this.btnUpdate.Size = new System.Drawing.Size(80, 28); this.btnUpdate.Size = new System.Drawing.Size(80, 28);
this.btnUpdate.TabIndex = 4; this.btnUpdate.TabIndex = 4;
this.btnUpdate.TabStop = false; this.btnUpdate.TabStop = false;
this.btnUpdate.Text = "修改保存(&E)"; this.btnUpdate.Text = "修改保存(E)";
// //
// ddb_common // ddb_common
// //
@@ -342,7 +342,7 @@ namespace Lskj.Control
this.btnApply.Name = "btnApply"; this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(80, 28); this.btnApply.Size = new System.Drawing.Size(80, 28);
this.btnApply.TabIndex = 5; this.btnApply.TabIndex = 5;
this.btnApply.Text = "提交审核(&R)"; this.btnApply.Text = "提交审核(R)";
// //
// btnAdd // btnAdd
// //
@@ -353,7 +353,7 @@ namespace Lskj.Control
this.btnAdd.Size = new System.Drawing.Size(80, 28); this.btnAdd.Size = new System.Drawing.Size(80, 28);
this.btnAdd.TabIndex = 3; this.btnAdd.TabIndex = 3;
this.btnAdd.TabStop = false; this.btnAdd.TabStop = false;
this.btnAdd.Text = "添加保存(&A)"; this.btnAdd.Text = "添加保存(A)";
// //
// btnClose // btnClose
// //
@@ -364,7 +364,7 @@ namespace Lskj.Control
this.btnClose.Size = new System.Drawing.Size(80, 28); this.btnClose.Size = new System.Drawing.Size(80, 28);
this.btnClose.TabIndex = 10; this.btnClose.TabIndex = 10;
this.btnClose.TabStop = false; this.btnClose.TabStop = false;
this.btnClose.Text = "退出(&C)"; this.btnClose.Text = "退出(C)";
// //
// simpleButton1 // simpleButton1
// //
+28 -3
View File
@@ -47,6 +47,9 @@ namespace Lskj.Control
/// </summary> /// </summary>
public partial class ModulePanelEx : UserControl public partial class ModulePanelEx : UserControl
{ {
private readonly AltButtonShortcutManager mAltButtonShortcuts =
new AltButtonShortcutManager();
public LabelTextEdit ScanEdit { get { return this._scanEdit; } } public LabelTextEdit ScanEdit { get { return this._scanEdit; } }
#region private property #region private property
@@ -228,6 +231,7 @@ namespace Lskj.Control
{ {
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true); SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);
InitializeComponent(); InitializeComponent();
InitializeAltButtonShortcuts();
this.scc_container.PanelVisibility = SplitPanelVisibility.Panel1; this.scc_container.PanelVisibility = SplitPanelVisibility.Panel1;
this.simpleButton1.Click += simpleButton1_Click; this.simpleButton1.Click += simpleButton1_Click;
this.btnClear.Click += OnBtnClearClick; this.btnClear.Click += OnBtnClearClick;
@@ -241,6 +245,22 @@ namespace Lskj.Control
this.BtnMesClose.Click += OnBtnMesCloseClick; this.BtnMesClose.Click += OnBtnMesCloseClick;
} }
private void InitializeAltButtonShortcuts()
{
mAltButtonShortcuts.Register(btnAttach, Keys.F);
mAltButtonShortcuts.Register(btnUpdate, Keys.E);
mAltButtonShortcuts.Register(btnApply, Keys.R);
mAltButtonShortcuts.Register(btnAdd, Keys.A);
mAltButtonShortcuts.Register(btnClose, Keys.C);
}
protected override bool ProcessCmdKey(
ref System.Windows.Forms.Message msg, Keys keyData)
{
return mAltButtonShortcuts.ProcessKey(keyData) ||
base.ProcessCmdKey(ref msg, keyData);
}
#region private method #region private method
/// <summary> /// <summary>
/// <para>说明:控制滚动条是否存在横向的</para> /// <para>说明:控制滚动条是否存在横向的</para>
@@ -360,9 +380,9 @@ namespace Lskj.Control
this.btnUpdate.Location = this.btnApply.Location; this.btnUpdate.Location = this.btnApply.Location;
} }
// 设置文本 // 设置文本
btnAdd.Text = !string.IsNullOrWhiteSpace(this.SysModel.AddCaption) ? this.SysModel.AddCaption : "添加保存(&A)"; btnAdd.Text = !string.IsNullOrWhiteSpace(this.SysModel.AddCaption) ? this.SysModel.AddCaption : "添加保存(A)";
btnUpdate.Text = !string.IsNullOrWhiteSpace(this.SysModel.ModifyCaption) ? this.SysModel.ModifyCaption : "修改保存(&E)"; btnUpdate.Text = !string.IsNullOrWhiteSpace(this.SysModel.ModifyCaption) ? this.SysModel.ModifyCaption : "修改保存(E)";
btnApply.Text = !string.IsNullOrWhiteSpace(this.SysModel.ApplyCaption) ? this.SysModel.ApplyCaption : "提交审核(&R)"; btnApply.Text = !string.IsNullOrWhiteSpace(this.SysModel.ApplyCaption) ? this.SysModel.ApplyCaption : "提交审核(R)";
//隐藏帮助文档按钮 //隐藏帮助文档按钮
if (SystemInfo.Instance.HideHelpDocument) this.simpleButton1.Visible = false; if (SystemInfo.Instance.HideHelpDocument) this.simpleButton1.Visible = false;
@@ -766,6 +786,7 @@ namespace Lskj.Control
{ {
try try
{ {
this.pl_main.Visible = false;
if (sysModel != null && dyncModel != null) if (sysModel != null && dyncModel != null)
{ {
this.SysModel = sysModel; this.SysModel = sysModel;
@@ -1423,6 +1444,10 @@ namespace Lskj.Control
string Message = ErrorMessage.PromptErrorMessage(ex); string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message); MessageUtil.Show(Message, ex.Message);
} }
finally
{
this.pl_main.Visible = true;
}
} }
/// <summary> /// <summary>
@@ -121,7 +121,7 @@ namespace Lskj.Control
{ {
if (Model != null && Model.DataCaches != null) if (Model != null && Model.DataCaches != null)
{ {
Model.DataCaches.Remove(this); Model.DataCaches.RemoveCache(this);
} }
} }
catch catch
+2 -1
View File
@@ -431,7 +431,7 @@ namespace Lskj.Core
} }
if (connectionType == ConnectionType.SqlServer) if (connectionType == ConnectionType.SqlServer)
{ {
connStr = EnableSqlServerIdleConnectionResilience(connStr); //connStr = EnableSqlServerIdleConnectionResilience(connStr);
} }
SqlHelper.dbFactory = DbProviderFactories.GetFactory(providerName); SqlHelper.dbFactory = DbProviderFactories.GetFactory(providerName);
if (SqlHelper._connection != null) if (SqlHelper._connection != null)
@@ -460,6 +460,7 @@ namespace Lskj.Core
} }
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.Instance.WriteLog(ex.Message);
Console.WriteLine(ex.Message); Console.WriteLine(ex.Message);
} }
return isConnect; return isConnect;
@@ -4563,6 +4563,29 @@ namespace Lskj.Main.Control
return false; return false;
} }
//切换账套后,直接进入程序界面,去设置对应的子菜单,暂不开放
//if (!SystemInfo.Instance.IsChangeZTReturnMainForm)
//{
// DataTable MainTable = MainImpl.EnableSubSystem();
// ERPInfo.Instance.SubMenuCount = MainTable.Rows.Count;
// DataRow[] subrows = MainTable.Select(string.Format("SubSysId={0}", ERPInfo.Instance.SubSysId));
// if (subrows != null && subrows.Length > 0)
// {
// ERPInfo.Instance.SubSysId = subrows[0]["SubSysId"] + "";
// ERPInfo.Instance.SubSysName = subrows[0]["SubSysName"] + "";
// }
// else
// {
// if (MainTable.Rows.Count >0)
// {
// ERPInfo.Instance.SubSysId = MainTable.Rows[0]["SubSysId"] + "";
// ERPInfo.Instance.SubSysName = MainTable.Rows[0]["SubSysName"] + "";
// }
// }
//}
Manager.ReStartMain(!SystemInfo.Instance.IsChangeZTReturnMainForm); Manager.ReStartMain(!SystemInfo.Instance.IsChangeZTReturnMainForm);
return true; return true;
} }
+3
View File
@@ -62,6 +62,9 @@ namespace Lskj.Main
/// 水印层 /// 水印层
/// </summary> /// </summary>
private FrmWatermark watermarkForm; private FrmWatermark watermarkForm;
public FrmMain() public FrmMain()
{ {
Graphics graphics = this.CreateGraphics(); Graphics graphics = this.CreateGraphics();
+1 -1
View File
@@ -462,7 +462,7 @@ namespace Lskj.Main.Model
private static string BuildBsMenuUrl(string dllName, string dllCoid) private static string BuildBsMenuUrl(string dllName, string dllCoid)
{ {
return string.Format( return string.Format(
"pages/app/app.html?xtype={0}&dllcoid={1}&username={2}&password={3}", "pages/app/app.html?xtype={0}&dllcoid={1}&username={2}&password={3}&f=1",
dllName, dllName,
dllCoid, dllCoid,
ERPInfo.Instance.UserName, ERPInfo.Instance.UserName,
@@ -432,7 +432,7 @@
this.btnSave.Name = "btnSave"; this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(67, 23); this.btnSave.Size = new System.Drawing.Size(67, 23);
this.btnSave.TabIndex = 17; this.btnSave.TabIndex = 17;
this.btnSave.Text = "保存(&S)"; this.btnSave.Text = "保存(S)";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click); this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
// //
// dpb_Tools // dpb_Tools
@@ -481,7 +481,7 @@
this.btnSpare.Name = "btnSpare"; this.btnSpare.Name = "btnSpare";
this.btnSpare.Size = new System.Drawing.Size(67, 23); this.btnSpare.Size = new System.Drawing.Size(67, 23);
this.btnSpare.TabIndex = 19; this.btnSpare.TabIndex = 19;
this.btnSpare.Text = "分单(&P)"; this.btnSpare.Text = "分单(P)";
this.btnSpare.Click += new System.EventHandler(this.btnSpare_Click); this.btnSpare.Click += new System.EventHandler(this.btnSpare_Click);
// //
// btnPrint // btnPrint
@@ -508,7 +508,7 @@
this.btnClose.Name = "btnClose"; this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(75, 23); this.btnClose.Size = new System.Drawing.Size(75, 23);
this.btnClose.TabIndex = 5; this.btnClose.TabIndex = 5;
this.btnClose.Text = "关闭(&Q)"; this.btnClose.Text = "关闭(Q)";
this.btnClose.Click += new System.EventHandler(this.btnClose_Click); this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
// //
// btnRemindBack // btnRemindBack
@@ -533,7 +533,7 @@
this.btnBack.Name = "btnBack"; this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(75, 23); this.btnBack.Size = new System.Drawing.Size(75, 23);
this.btnBack.TabIndex = 4; this.btnBack.TabIndex = 4;
this.btnBack.Text = "返退(&N)"; this.btnBack.Text = "返退(N)";
this.btnBack.Click += new System.EventHandler(this.btnReturn_Click); this.btnBack.Click += new System.EventHandler(this.btnReturn_Click);
// //
// btnRemindAccradit // btnRemindAccradit
@@ -558,7 +558,7 @@
this.btnAccradit.Name = "btnAccradit"; this.btnAccradit.Name = "btnAccradit";
this.btnAccradit.Size = new System.Drawing.Size(75, 23); this.btnAccradit.Size = new System.Drawing.Size(75, 23);
this.btnAccradit.TabIndex = 3; this.btnAccradit.TabIndex = 3;
this.btnAccradit.Text = "审核(&Y)"; this.btnAccradit.Text = "审核(Y)";
this.btnAccradit.Click += new System.EventHandler(this.btnAccradit_Click); this.btnAccradit.Click += new System.EventHandler(this.btnAccradit_Click);
// //
// label_date // label_date
@@ -44,9 +44,29 @@ namespace Lskj.PubAccraditation
/// </summary> /// </summary>
public partial class FrmAccraditation : BaseForm public partial class FrmAccraditation : BaseForm
{ {
private readonly AltButtonShortcutManager mAltButtonShortcuts =
new AltButtonShortcutManager();
public FrmAccraditation() public FrmAccraditation()
{ {
InitializeComponent(); InitializeComponent();
InitializeAltButtonShortcuts();
}
private void InitializeAltButtonShortcuts()
{
mAltButtonShortcuts.Register(btnSave, Keys.S);
mAltButtonShortcuts.Register(btnSpare, Keys.P);
mAltButtonShortcuts.Register(btnClose, Keys.Q);
mAltButtonShortcuts.Register(btnBack, Keys.N);
mAltButtonShortcuts.Register(btnAccradit, Keys.Y);
}
protected override bool ProcessCmdKey(
ref System.Windows.Forms.Message msg, Keys keyData)
{
return mAltButtonShortcuts.ProcessKey(keyData) ||
base.ProcessCmdKey(ref msg, keyData);
} }
private void ReleaseResourcesForDispose() private void ReleaseResourcesForDispose()
@@ -89,7 +109,7 @@ namespace Lskj.PubAccraditation
} }
if (SysModel != null && SysModel.DataCaches != null) if (SysModel != null && SysModel.DataCaches != null)
{ {
SysModel.DataCaches.Remove(this); SysModel.DataCaches.RemoveCache(this);
} }
} }
catch catch
@@ -2203,8 +2223,8 @@ namespace Lskj.PubAccraditation
{ {
this.btnAccradit.Enabled = true; this.btnAccradit.Enabled = true;
this.btnRemindAccradit.Visible = this.btnRemindBack.Visible = this.btnSave.Visible = this.btnClose.Visible = this.btnSpare.Visible = this.btnBack.Visible = false; this.btnRemindAccradit.Visible = this.btnRemindBack.Visible = this.btnSave.Visible = this.btnClose.Visible = this.btnSpare.Visible = this.btnBack.Visible = false;
this.btnAccradit.Text = "确认(&Y)"; this.btnAccradit.Text = "确认(Y)";
this.btnAccradit.Text = "确认(&Y)"; this.btnAccradit.Text = "确认(Y)";
this.label_auditPerson.Text = "确认意见"; this.label_auditPerson.Text = "确认意见";
this.label_date.EditText = "会签人"; this.label_date.EditText = "会签人";
this.txtRemark.Text = "确认"; this.txtRemark.Text = "确认";
+7 -6
View File
@@ -28,16 +28,17 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.barManager1 = new DevExpress.XtraBars.BarManager(); this.components = new System.ComponentModel.Container();
this.barManager1 = new DevExpress.XtraBars.BarManager(this.components);
this.barDockControl1 = new DevExpress.XtraBars.BarDockControl(); this.barDockControl1 = new DevExpress.XtraBars.BarDockControl();
this.barDockControl2 = new DevExpress.XtraBars.BarDockControl(); this.barDockControl2 = new DevExpress.XtraBars.BarDockControl();
this.barDockControl3 = new DevExpress.XtraBars.BarDockControl(); this.barDockControl3 = new DevExpress.XtraBars.BarDockControl();
this.barDockControl5 = new DevExpress.XtraBars.BarDockControl(); this.barDockControl5 = new DevExpress.XtraBars.BarDockControl();
this.pmFP = new DevExpress.XtraBars.PopupMenu(); this.pmFP = new DevExpress.XtraBars.PopupMenu(this.components);
this.pmBillExp = new DevExpress.XtraBars.PopupMenu(); this.pmBillExp = new DevExpress.XtraBars.PopupMenu(this.components);
this.pmBill = new DevExpress.XtraBars.PopupMenu(); this.pmBill = new DevExpress.XtraBars.PopupMenu(this.components);
this.pMprint = new DevExpress.XtraBars.PopupMenu(); this.pMprint = new DevExpress.XtraBars.PopupMenu(this.components);
this.pMenu = new DevExpress.XtraBars.PopupMenu(); this.pMenu = new DevExpress.XtraBars.PopupMenu(this.components);
this.tb_buttom = new Lskj.Control.TabControlEx(); this.tb_buttom = new Lskj.Control.TabControlEx();
this.ssc_main_top = new DevExpress.XtraEditors.SplitContainerControl(); this.ssc_main_top = new DevExpress.XtraEditors.SplitContainerControl();
this.pl_left = new DevExpress.XtraEditors.PanelControl(); this.pl_left = new DevExpress.XtraEditors.PanelControl();
+3 -3
View File
@@ -3110,7 +3110,7 @@ namespace Lskj.PubBill
// 单据为新增状态 // 单据为新增状态
this.dbpFP.Enabled = this.btnDelete.Enabled = this.btnBillSave.Enabled = this.btnBillApply.Enabled = true; this.dbpFP.Enabled = this.btnDelete.Enabled = this.btnBillSave.Enabled = this.btnBillApply.Enabled = true;
this.lbTitle.Text = this.BillModel.TypeName + addText; this.lbTitle.Text = this.BillModel.TypeName + addText;
this.lblOrderNo.Text = BillImpl.GetBillNo(this.BillModel.BillSeq); this.lblOrderNo.Text = BillModel.NewVer == 0? BillImpl.GetBillNo(this.BillModel.BillSeq):"";
this._itemImport.Enabled = this._itemImportUpdate.Enabled = true; this._itemImport.Enabled = this._itemImportUpdate.Enabled = true;
this.cb_input.Enabled = this.btn_input.Enabled = this.txt_input.Enabled = true; this.cb_input.Enabled = this.btn_input.Enabled = this.txt_input.Enabled = true;
this.cb_templete.Enabled = true; this.cb_templete.Enabled = true;
@@ -3242,7 +3242,7 @@ namespace Lskj.PubBill
this.dbpFP.Enabled = this.btnDelete.Enabled = this.btnBillSave.Enabled = this.btnBillApply.Enabled = true; this.dbpFP.Enabled = this.btnDelete.Enabled = this.btnBillSave.Enabled = this.btnBillApply.Enabled = true;
this.lbTitle.Text = this.BillModel.TypeName + addText; this.lbTitle.Text = this.BillModel.TypeName + addText;
this.lbTitle.Invalidate(); this.lbTitle.Invalidate();
this.lblOrderNo.Text = BillImpl.GetBillNo(this.BillModel.BillSeq); this.lblOrderNo.Text = BillModel.NewVer == 0 ? BillImpl.GetBillNo(this.BillModel.BillSeq) : "";
this.BillModel.SaveState = false; this.BillModel.SaveState = false;
this.rdBlue.Enabled = this.rdRed.Enabled = true; this.rdBlue.Enabled = this.rdRed.Enabled = true;
this.cb_input.Enabled = this.btn_input.Enabled = this.txt_input.Enabled = true; this.cb_input.Enabled = this.btn_input.Enabled = this.txt_input.Enabled = true;
@@ -3290,7 +3290,7 @@ namespace Lskj.PubBill
this.dbpFP.Enabled = this.btnDelete.Enabled = this.btnBillSave.Enabled = this.btnBillApply.Enabled = true; this.dbpFP.Enabled = this.btnDelete.Enabled = this.btnBillSave.Enabled = this.btnBillApply.Enabled = true;
this.lbTitle.Text = this.BillModel.TypeName + addText; this.lbTitle.Text = this.BillModel.TypeName + addText;
this.lbTitle.Invalidate(); this.lbTitle.Invalidate();
this.lblOrderNo.Text = BillImpl.GetBillNo(this.BillModel.BillSeq); this.lblOrderNo.Text = BillModel.NewVer == 0 ? BillImpl.GetBillNo(this.BillModel.BillSeq) : "";
this.rdBlue.Enabled = this.rdRed.Enabled = true; this.rdBlue.Enabled = this.rdRed.Enabled = true;
this.cb_input.Enabled = this.btn_input.Enabled = this.txt_input.Enabled = true; this.cb_input.Enabled = this.btn_input.Enabled = this.txt_input.Enabled = true;
this._itemImport.Enabled = this._itemImportUpdate.Enabled = true; this._itemImport.Enabled = this._itemImportUpdate.Enabled = true;
+11 -1
View File
@@ -13,10 +13,20 @@
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing && (components != null)) if (disposing)
{
if (cellHelper != null)
{
cellHelper.Dispose();
cellHelper = null;
}
class2_0 = null;
class2_1 = null;
if (components != null)
{ {
components.Dispose(); components.Dispose();
} }
}
base.Dispose(disposing); base.Dispose(disposing);
} }
-23
View File
@@ -33,31 +33,8 @@ namespace Lskj.PubBrower
this.SubForm = main; this.SubForm = main;
this.SubForm.Text = moduleModel.FormText; this.SubForm.Text = moduleModel.FormText;
main.PubBrowerModel = moduleModel; main.PubBrowerModel = moduleModel;
// CEF must be created after the caller has established the final
// WinForms owner/parent hierarchy and the form HWND exists.
if (moduleModel.downLoadFlag == 1)
{
main.OnLoad(); main.OnLoad();
} }
else
{
EventHandler shown = null;
shown = delegate
{
main.Shown -= shown;
try
{
main.OnLoad();
}
catch (Exception ex)
{
LogUtil.WriteError("Lskj.PubBrower.dll--初始化错误-->" + obj.ToString(), ex);
}
};
main.Shown += shown;
}
}
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.WriteError("Lskj.PubBrower.dll--参数错误-->" + obj.ToString(), ex); LogUtil.WriteError("Lskj.PubBrower.dll--参数错误-->" + obj.ToString(), ex);
+1 -1
View File
@@ -100,8 +100,8 @@ namespace Lskj.PubBrower
previewFrm previewFrm = new previewFrm(); previewFrm previewFrm = new previewFrm();
previewFrm.moduleWebView.PubBrowerModel = this.PubBrowerModel; previewFrm.moduleWebView.PubBrowerModel = this.PubBrowerModel;
previewFrm.Dock = DockStyle.Fill; previewFrm.Dock = DockStyle.Fill;
this.Controls.Add(previewFrm);
previewFrm.OnLoad(url, RightKeyFlag); previewFrm.OnLoad(url, RightKeyFlag);
this.Controls.Add(previewFrm);
} }
} }
catch (Exception ex) catch (Exception ex)
+14
View File
@@ -16,6 +16,7 @@ namespace Lskj.PubBrower
public previewFrm() public previewFrm()
{ {
InitializeComponent(); InitializeComponent();
this.SizeChanged += OnSizeChanged;
} }
/// <summary> /// <summary>
/// <para>说明:窗口加载</para> /// <para>说明:窗口加载</para>
@@ -47,5 +48,18 @@ namespace Lskj.PubBrower
MessageUtil.Show(Message, ex.Message); MessageUtil.Show(Message, ex.Message);
} }
} }
/// <summary>
/// 窗体大小改变时
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnSizeChanged(object sender, EventArgs e)
{
if (this.moduleWebView.cefBrowserSettings != null)
{
var handle = this.moduleWebView.cefBrowserSettings.GetHost().GetWindowHandle();
this.moduleWebView.ResizeWindow(handle, this.Width, this.Height);
}
}
} }
} }
-23
View File
@@ -33,31 +33,8 @@ namespace Lskj.PubBrower2
this.SubForm = main; this.SubForm = main;
this.SubForm.Text = moduleModel.FormText; this.SubForm.Text = moduleModel.FormText;
main.PubBrowerModel = moduleModel; main.PubBrowerModel = moduleModel;
// CEF must be created after the caller has established the final
// WinForms owner/parent hierarchy and the form HWND exists.
if (moduleModel.downLoadFlag == 1)
{
main.OnLoad(); main.OnLoad();
} }
else
{
EventHandler shown = null;
shown = delegate
{
main.Shown -= shown;
try
{
main.OnLoad();
}
catch (Exception ex)
{
LogUtil.WriteError("Lskj.PubBrower2.dll--初始化错误-->" + obj.ToString(), ex);
}
};
main.Shown += shown;
}
}
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.WriteError("Lskj.PubBrower2.dll--参数错误-->" + obj.ToString(), ex); LogUtil.WriteError("Lskj.PubBrower2.dll--参数错误-->" + obj.ToString(), ex);
+1 -1
View File
@@ -95,8 +95,8 @@ namespace Lskj.PubBrower2
previewFrm previewFrm = new previewFrm(); previewFrm previewFrm = new previewFrm();
previewFrm.moduleWebView.PubBrowerModel = this.PubBrowerModel; previewFrm.moduleWebView.PubBrowerModel = this.PubBrowerModel;
previewFrm.Dock = DockStyle.Fill; previewFrm.Dock = DockStyle.Fill;
this.Controls.Add(previewFrm);
previewFrm.OnLoad(url, RightKeyFlag); previewFrm.OnLoad(url, RightKeyFlag);
this.Controls.Add(previewFrm);
} }
} }
+14
View File
@@ -16,6 +16,7 @@ namespace Lskj.PubBrower2
public previewFrm() public previewFrm()
{ {
InitializeComponent(); InitializeComponent();
this.SizeChanged += OnSizeChanged;
} }
/// <summary> /// <summary>
/// <para>说明:窗口加载</para> /// <para>说明:窗口加载</para>
@@ -48,5 +49,18 @@ namespace Lskj.PubBrower2
} }
} }
/// <summary>
/// 窗体大小改变时
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnSizeChanged(object sender, EventArgs e)
{
if (this.moduleWebView.cefBrowserSettings != null)
{
var handle = this.moduleWebView.cefBrowserSettings.GetHost().GetWindowHandle();
this.moduleWebView.ResizeWindow(handle, this.Width, this.Height);
}
}
} }
} }
+39 -31
View File
@@ -211,13 +211,14 @@ namespace Lskj.PubModuleDetail
Dictionary<object, Hashtable> dataCaches = Dictionary<object, Hashtable> dataCaches =
Model != null ? Model.DataCaches : null; Model != null ? Model.DataCaches : null;
if (dataCaches == null || !AreDataCacheTasksCompleted(dataCaches)) HashSet<Task> completedTasks;
if (dataCaches == null ||
!TryDetachCompletedCacheTasks(dataCaches, out completedTasks))
{ {
return; return;
} }
DisposeCompletedCacheTasks(dataCaches); DisposeCompletedCacheTasks(completedTasks);
dataCaches.Clear();
} }
/// <summary> /// <summary>
@@ -225,34 +226,10 @@ namespace Lskj.PubModuleDetail
/// Task.Result 在等待时可能创建底层等待对象,仅清空字典 /// Task.Result 在等待时可能创建底层等待对象,仅清空字典
/// 不会立即释放这些句柄。 /// 不会立即释放这些句柄。
/// </summary> /// </summary>
private static void DisposeCompletedCacheTasks( private static void DisposeCompletedCacheTasks(IEnumerable<Task> tasks)
Dictionary<object, Hashtable> dataCaches)
{ {
HashSet<Task> tasks = new HashSet<Task>();
foreach (Hashtable cache in dataCaches.Values)
{
if (cache == null)
{
continue;
}
foreach (object value in cache.Values)
{
Task task = value as Task;
if (task != null)
{
tasks.Add(task);
}
}
}
foreach (Task task in tasks) foreach (Task task in tasks)
{ {
if (!task.IsCompleted)
{
continue;
}
try try
{ {
task.Dispose(); task.Dispose();
@@ -264,27 +241,58 @@ namespace Lskj.PubModuleDetail
} }
/// <summary> /// <summary>
/// 并行初始化仍在运行时不能清空缓存字典,后台任务还会读取或追加其中的数据 /// 仅当并行初始化全部完成时,才在同一同步区间摘除缓存任务
/// AddTask 使用同一个字典实例加锁,避免检查后又插入新任务。
/// </summary> /// </summary>
private static bool AreDataCacheTasksCompleted(Dictionary<object, Hashtable> dataCaches) private static bool TryDetachCompletedCacheTasks(
Dictionary<object, Hashtable> dataCaches,
out HashSet<Task> completedTasks)
{ {
completedTasks = new HashSet<Task>();
try try
{
lock (dataCaches)
{ {
foreach (Hashtable cacheValues in dataCaches.Values) foreach (Hashtable cacheValues in dataCaches.Values)
{ {
if (cacheValues == null)
{
continue;
}
foreach (object value in cacheValues.Values) foreach (object value in cacheValues.Values)
{ {
Task task = value as Task; Task task = value as Task;
if (task != null && !task.IsCompleted) if (task == null)
{ {
continue;
}
try
{
if (!task.IsCompleted)
{
completedTasks.Clear();
return false; return false;
} }
} }
catch (ObjectDisposedException)
{
continue;
} }
completedTasks.Add(task);
}
}
dataCaches.Clear();
}
return true; return true;
} }
catch (InvalidOperationException) catch (InvalidOperationException)
{ {
completedTasks.Clear();
return false; return false;
} }
} }
+7 -5
View File
@@ -133,9 +133,11 @@
this.gcMain.AdapterObj = null; this.gcMain.AdapterObj = null;
this.gcMain.Dock = System.Windows.Forms.DockStyle.Fill; this.gcMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.gcMain.Location = new System.Drawing.Point(0, 0); this.gcMain.Location = new System.Drawing.Point(0, 0);
this.gcMain.Margin = new System.Windows.Forms.Padding(4);
this.gcMain.Name = "gcMain"; this.gcMain.Name = "gcMain";
this.gcMain.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum; this.gcMain.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
this.gcMain.Size = new System.Drawing.Size(597, 548); this.gcMain.Size = new System.Drawing.Size(597, 548);
this.gcMain.SysModel = null;
this.gcMain.TabIndex = 2; this.gcMain.TabIndex = 2;
// //
// panelControl4 // panelControl4
@@ -173,7 +175,7 @@
this.btnExport.Name = "btnExport"; this.btnExport.Name = "btnExport";
this.btnExport.Size = new System.Drawing.Size(72, 26); this.btnExport.Size = new System.Drawing.Size(72, 26);
this.btnExport.TabIndex = 15; this.btnExport.TabIndex = 15;
this.btnExport.Text = "导出(&E)"; this.btnExport.Text = "导出(E)";
this.btnExport.Click += new System.EventHandler(this.OnExportClick); this.btnExport.Click += new System.EventHandler(this.OnExportClick);
// //
// btnShowAll // btnShowAll
@@ -193,7 +195,7 @@
this.btnSave.Name = "btnSave"; this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(72, 26); this.btnSave.Size = new System.Drawing.Size(72, 26);
this.btnSave.TabIndex = 13; this.btnSave.TabIndex = 13;
this.btnSave.Text = "保存(&S)"; this.btnSave.Text = "保存(S)";
this.btnSave.Click += new System.EventHandler(this.OnSaveButtonClick); this.btnSave.Click += new System.EventHandler(this.OnSaveButtonClick);
// //
// btnDelete // btnDelete
@@ -203,7 +205,7 @@
this.btnDelete.Name = "btnDelete"; this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(72, 26); this.btnDelete.Size = new System.Drawing.Size(72, 26);
this.btnDelete.TabIndex = 12; this.btnDelete.TabIndex = 12;
this.btnDelete.Text = "删除(&D)"; this.btnDelete.Text = "删除(D)";
this.btnDelete.Click += new System.EventHandler(this.OnDeleteButtonClick); this.btnDelete.Click += new System.EventHandler(this.OnDeleteButtonClick);
// //
// btnAdd // btnAdd
@@ -213,7 +215,7 @@
this.btnAdd.Name = "btnAdd"; this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(72, 26); this.btnAdd.Size = new System.Drawing.Size(72, 26);
this.btnAdd.TabIndex = 11; this.btnAdd.TabIndex = 11;
this.btnAdd.Text = "增加(&A)"; this.btnAdd.Text = "增加(A)";
this.btnAdd.Click += new System.EventHandler(this.OnAddButtonClick); this.btnAdd.Click += new System.EventHandler(this.OnAddButtonClick);
// //
// btnRefresh // btnRefresh
@@ -223,7 +225,7 @@
this.btnRefresh.Name = "btnRefresh"; this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(72, 26); this.btnRefresh.Size = new System.Drawing.Size(72, 26);
this.btnRefresh.TabIndex = 10; this.btnRefresh.TabIndex = 10;
this.btnRefresh.Text = "刷新(&R)"; this.btnRefresh.Text = "刷新(R)";
this.btnRefresh.Click += new System.EventHandler(this.OnRefreshButtonClick); this.btnRefresh.Click += new System.EventHandler(this.OnRefreshButtonClick);
// //
// panelControl3 // panelControl3
+20
View File
@@ -30,6 +30,9 @@ namespace Lskj.PubSpec
{ {
public partial class FrmMain : BaseForm public partial class FrmMain : BaseForm
{ {
private readonly AltButtonShortcutManager mAltButtonShortcuts =
new AltButtonShortcutManager();
private bool _existsPid = false; private bool _existsPid = false;
/// <summary> /// <summary>
/// 主键 /// 主键
@@ -59,6 +62,23 @@ namespace Lskj.PubSpec
public FrmMain() public FrmMain()
{ {
InitializeComponent(); InitializeComponent();
InitializeAltButtonShortcuts();
}
private void InitializeAltButtonShortcuts()
{
mAltButtonShortcuts.Register(btnExport, Keys.E);
mAltButtonShortcuts.Register(btnSave, Keys.S);
mAltButtonShortcuts.Register(btnDelete, Keys.D);
mAltButtonShortcuts.Register(btnAdd, Keys.A);
mAltButtonShortcuts.Register(btnRefresh, Keys.R);
}
protected override bool ProcessCmdKey(
ref System.Windows.Forms.Message msg, Keys keyData)
{
return mAltButtonShortcuts.ProcessKey(keyData) ||
base.ProcessCmdKey(ref msg, keyData);
} }
/// <summary> /// <summary>
+2 -2
View File
@@ -213,7 +213,7 @@
this.btnExport.Name = "btnExport"; this.btnExport.Name = "btnExport";
this.btnExport.Size = new System.Drawing.Size(72, 26); this.btnExport.Size = new System.Drawing.Size(72, 26);
this.btnExport.TabIndex = 19; this.btnExport.TabIndex = 19;
this.btnExport.Text = "导出(&E)"; this.btnExport.Text = "导出(E)";
this.btnExport.Click += new System.EventHandler(this.OnExportClick); this.btnExport.Click += new System.EventHandler(this.OnExportClick);
// //
// btnShowAll // btnShowAll
@@ -233,7 +233,7 @@
this.btnRefresh.Name = "btnRefresh"; this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(72, 26); this.btnRefresh.Size = new System.Drawing.Size(72, 26);
this.btnRefresh.TabIndex = 17; this.btnRefresh.TabIndex = 17;
this.btnRefresh.Text = "刷新(&R)"; this.btnRefresh.Text = "刷新(R)";
this.btnRefresh.Click += new System.EventHandler(this.OnRefreshButtonClick); this.btnRefresh.Click += new System.EventHandler(this.OnRefreshButtonClick);
// //
// FrmMain // FrmMain
+17
View File
@@ -28,6 +28,9 @@ namespace Lskj.PubSpec2
{ {
public partial class FrmMain : BaseForm public partial class FrmMain : BaseForm
{ {
private readonly AltButtonShortcutManager mAltButtonShortcuts =
new AltButtonShortcutManager();
private bool _existsPid = false; private bool _existsPid = false;
/// <summary> /// <summary>
/// 主键 /// 主键
@@ -55,6 +58,20 @@ namespace Lskj.PubSpec2
public FrmMain() public FrmMain()
{ {
InitializeComponent(); InitializeComponent();
InitializeAltButtonShortcuts();
}
private void InitializeAltButtonShortcuts()
{
mAltButtonShortcuts.Register(btnExport, Keys.E);
mAltButtonShortcuts.Register(btnRefresh, Keys.R);
}
protected override bool ProcessCmdKey(
ref System.Windows.Forms.Message msg, Keys keyData)
{
return mAltButtonShortcuts.ProcessKey(keyData) ||
base.ProcessCmdKey(ref msg, keyData);
} }
private void ReleaseResourcesForDispose() private void ReleaseResourcesForDispose()
+1 -229
View File
@@ -13,7 +13,6 @@ using System.ComponentModel;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using Lskj.Control; using Lskj.Control;
using Lskj.Model; using Lskj.Model;
@@ -24,7 +23,6 @@ using Lskj.Business.Impl;
using Lskj.Business; using Lskj.Business;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Collections; using System.Collections;
using System.IO;
using System.Reflection; using System.Reflection;
namespace Lskj.Report namespace Lskj.Report
@@ -42,8 +40,6 @@ namespace Lskj.Report
mReportGridLocalizerViews = mReportGridLocalizerViews =
new HashSet<DevExpress.XtraGrid.Views.Base.BaseView>(); new HashSet<DevExpress.XtraGrid.Views.Base.BaseView>();
private bool mReportGridResourcesReleased; private bool mReportGridResourcesReleased;
private int mDisposedReportGridViewCount;
private int mRemovedGridLocalizerHandlerCount;
public FrmMain() public FrmMain()
{ {
@@ -99,19 +95,12 @@ namespace Lskj.Report
private void OnClose(object sender, FormClosingEventArgs e) private void OnClose(object sender, FormClosingEventArgs e)
{ {
WriteReportLifecycleDiagnostics("closing-before-close-module");
this.mControl.CloseModule(); this.mControl.CloseModule();
WriteReportLifecycleDiagnostics("closing-after-close-module");
} }
private void OnFrmMainDisposed(object sender, EventArgs e) private void OnFrmMainDisposed(object sender, EventArgs e)
{ {
DisposeReportGridViews(); DisposeReportGridViews();
WriteReportLifecycleDiagnostics(
"disposed-event;disposedGridViews=" +
mDisposedReportGridViewCount +
";gridLocalizerRemoved=" +
mRemovedGridLocalizerHandlerCount);
mReportGridLocalizerViews.Clear(); mReportGridLocalizerViews.Clear();
mPreexistingGridLocalizerViews.Clear(); mPreexistingGridLocalizerViews.Clear();
this.FormClosing -= OnClose; this.FormClosing -= OnClose;
@@ -126,7 +115,7 @@ namespace Lskj.Report
try try
{ {
model.DataCaches.Clear(); model.DataCaches.ClearCaches();
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -142,7 +131,6 @@ namespace Lskj.Report
} }
mReportGridResourcesReleased = true; mReportGridResourcesReleased = true;
WriteReportLifecycleDiagnostics("dispose-before-gridviews");
CaptureReportGridLocalizerViews(); CaptureReportGridLocalizerViews();
if (this.mControl != null) if (this.mControl != null)
{ {
@@ -151,8 +139,6 @@ namespace Lskj.Report
HashSet<DevExpress.XtraGrid.Views.Base.BaseView> disposedViews = HashSet<DevExpress.XtraGrid.Views.Base.BaseView> disposedViews =
new HashSet<DevExpress.XtraGrid.Views.Base.BaseView>(); new HashSet<DevExpress.XtraGrid.Views.Base.BaseView>();
int disposeErrorCount = 0;
int detachedDataSourceCount = 0;
foreach (System.Windows.Forms.Control control in foreach (System.Windows.Forms.Control control in
EnumerateControls(this.mControl)) EnumerateControls(this.mControl))
{ {
@@ -165,12 +151,10 @@ namespace Lskj.Report
if (gridControl.DataSource != null) if (gridControl.DataSource != null)
{ {
gridControl.DataSource = null; gridControl.DataSource = null;
detachedDataSourceCount++;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
disposeErrorCount++;
LogHelper.Instance.WriteError(ex, ResourceKeys.BaseReport); LogHelper.Instance.WriteError(ex, ResourceKeys.BaseReport);
} }
@@ -191,7 +175,6 @@ namespace Lskj.Report
} }
catch (Exception ex) catch (Exception ex)
{ {
disposeErrorCount++;
LogHelper.Instance.WriteError(ex, ResourceKeys.BaseReport); LogHelper.Instance.WriteError(ex, ResourceKeys.BaseReport);
} }
} }
@@ -216,33 +199,16 @@ namespace Lskj.Report
dataSourceProperty.GetValue(control, null) != null) dataSourceProperty.GetValue(control, null) != null)
{ {
dataSourceProperty.SetValue(control, null, null); dataSourceProperty.SetValue(control, null, null);
detachedDataSourceCount++;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
disposeErrorCount++;
LogHelper.Instance.WriteError(ex, ResourceKeys.BaseReport); LogHelper.Instance.WriteError(ex, ResourceKeys.BaseReport);
} }
} }
} }
int trackedGridViews = mReportGridLocalizerViews.Count;
int removedGridLocalizerHandlers =
ReleaseTrackedGridLocalizerViews(disposedViews); ReleaseTrackedGridLocalizerViews(disposedViews);
mDisposedReportGridViewCount = disposedViews.Count;
mRemovedGridLocalizerHandlerCount = removedGridLocalizerHandlers;
WriteReportLifecycleDiagnostics(
"dispose-after-gridviews;dispose-attempts=" +
disposedViews.Count +
";dispose-errors=" +
disposeErrorCount +
";detachedDataSources=" +
detachedDataSourceCount +
";trackedGridViews=" +
trackedGridViews +
";gridLocalizerRemoved=" +
removedGridLocalizerHandlers);
} }
private void CaptureReportGridLocalizerViews() private void CaptureReportGridLocalizerViews()
@@ -454,200 +420,6 @@ namespace Lskj.Report
handler.Target is DevExpress.XtraGrid.Views.Base.BaseView; handler.Target is DevExpress.XtraGrid.Views.Base.BaseView;
} }
private void WriteReportLifecycleDiagnostics(string phase)
{
if (!IsReportDiagnosticsEnabled())
{
return;
}
try
{
LogHelper.Instance.WriteLog(
"REPORT_DIAGNOSTIC phase=" +
(phase ?? string.Empty) +
" " +
GetReportGridDiagnostics(),
"ResourceDiagnostics.Report");
}
catch
{
// Diagnostics must never interfere with module close/dispose.
}
}
private string GetReportGridDiagnostics()
{
int controlCount = 0;
int gridControlCount = 0;
int viewCount = 0;
HashSet<DevExpress.XtraGrid.Views.Base.BaseView> views =
new HashSet<DevExpress.XtraGrid.Views.Base.BaseView>();
StringBuilder viewDetails = new StringBuilder();
try
{
if (this.mControl != null)
{
foreach (System.Windows.Forms.Control control in EnumerateControls(this.mControl))
{
controlCount++;
DevExpress.XtraGrid.GridControl gridControl =
control as DevExpress.XtraGrid.GridControl;
if (gridControl == null)
{
continue;
}
gridControlCount++;
foreach (DevExpress.XtraGrid.Views.Base.BaseView view in
gridControl.ViewCollection.Cast<DevExpress.XtraGrid.Views.Base.BaseView>())
{
if (view == null || !views.Add(view))
{
continue;
}
viewCount++;
if (viewDetails.Length < 1800)
{
if (viewDetails.Length > 0)
{
viewDetails.Append(",");
}
viewDetails.Append(SafeViewDescription(view));
}
}
}
}
}
catch (Exception exception)
{
viewDetails.Append(",enumeration-error=");
viewDetails.Append(exception.GetType().Name);
}
return "formDisposed=" +
this.IsDisposed +
";controlCount=" +
controlCount +
";gridControlCount=" +
gridControlCount +
";viewCount=" +
viewCount +
";views=" +
viewDetails +
";gridLocalizer=" +
DescribeGridLocalizer();
}
private static string SafeViewDescription(
DevExpress.XtraGrid.Views.Base.BaseView view)
{
try
{
return view.GetType().FullName +
":" +
(view.Name ?? string.Empty).Replace(";", ",");
}
catch
{
return "<view-description-error>";
}
}
private static string DescribeGridLocalizer()
{
try
{
var active =
DevExpress.XtraGrid.Localization.GridLocalizer.Active;
if (active == null)
{
return "active=null";
}
StringBuilder handlers = new StringBuilder();
int handlerCount = 0;
Type currentType = active.GetType();
while (currentType != null && currentType != typeof(object))
{
FieldInfo[] fields = currentType.GetFields(
BindingFlags.Instance |
BindingFlags.Static |
BindingFlags.Public |
BindingFlags.NonPublic |
BindingFlags.DeclaredOnly);
foreach (FieldInfo field in fields)
{
if (!typeof(Delegate).IsAssignableFrom(field.FieldType))
{
continue;
}
object owner = field.IsStatic ? null : (object)active;
Delegate value = field.GetValue(owner) as Delegate;
if (value == null)
{
continue;
}
foreach (Delegate handler in value.GetInvocationList())
{
handlerCount++;
if (handlers.Length < 1800)
{
if (handlers.Length > 0)
{
handlers.Append(",");
}
string targetType = handler.Target == null
? "static"
: handler.Target.GetType().FullName;
handlers.Append(field.Name.Replace(";", ","));
handlers.Append("->");
handlers.Append(targetType.Replace(";", ","));
handlers.Append(".");
handlers.Append(handler.Method.Name.Replace(";", ","));
}
}
}
currentType = currentType.BaseType;
}
return "activeType=" +
active.GetType().FullName.Replace(";", ",") +
";handlerCount=" +
handlerCount +
";handlers=" +
handlers;
}
catch (Exception exception)
{
return "localizer-error=" + exception.GetType().Name;
}
}
private static bool IsReportDiagnosticsEnabled()
{
try
{
return File.Exists(
Path.Combine(
AppDomain.CurrentDomain.BaseDirectory,
"Logs",
"ResourceDiagnostics",
"resource-diagnostics.enabled"));
}
catch
{
return false;
}
}
private static IEnumerable<System.Windows.Forms.Control> EnumerateControls( private static IEnumerable<System.Windows.Forms.Control> EnumerateControls(
System.Windows.Forms.Control root) System.Windows.Forms.Control root)
{ {
+73 -26
View File
@@ -197,27 +197,32 @@ namespace Lskj.Util
value = default; value = default;
return false; return false;
} }
if (dic.ContainsKey(control))
Task<T> task;
lock (dic)
{ {
if (dic[control].ContainsKey(key)) Hashtable cache;
if (!dic.TryGetValue(control, out cache) ||
cache == null ||
!cache.ContainsKey(key))
{ {
Task<T> task = dic[control][key] as Task<T>; value = default;
return false;
}
task = cache[key] as Task<T>;
}
if (task == null)
{
value = default;
return false;
}
value = task.Result; value = task.Result;
task.Dispose(); task.Dispose();
return true; return true;
} }
else
{
value = default;
return false;
}
}
else
{
value = default;
return false;
}
}
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine(ex.Message); Console.WriteLine(ex.Message);
@@ -237,14 +242,23 @@ namespace Lskj.Util
{ {
try try
{ {
if (cachesDic.ContainsKey(control) && cachesDic[control].ContainsKey(key)) if (cachesDic == null)
{
return (Task<T>)cachesDic[control][key];
}
else
{ {
return default; return default;
} }
lock (cachesDic)
{
Hashtable cache;
if (cachesDic.TryGetValue(control, out cache) &&
cache != null &&
cache.ContainsKey(key))
{
return cache[key] as Task<T>;
}
}
return default;
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -253,6 +267,36 @@ namespace Lskj.Util
} }
} }
/// <summary> /// <summary>
/// 在线程安全的同步区间内移除控件缓存。
/// </summary>
public static bool RemoveCache(this Dictionary<object, Hashtable> cachesDic, object control)
{
if (cachesDic == null)
{
return false;
}
lock (cachesDic)
{
return cachesDic.Remove(control);
}
}
/// <summary>
/// 在线程安全的同步区间内清空任务缓存。
/// </summary>
public static void ClearCaches(this Dictionary<object, Hashtable> cachesDic)
{
if (cachesDic == null)
{
return;
}
lock (cachesDic)
{
cachesDic.Clear();
}
}
/// <summary>
/// 添加任务 /// 添加任务
/// </summary> /// </summary>
/// <typeparam name="T"></typeparam> /// <typeparam name="T"></typeparam>
@@ -262,20 +306,23 @@ namespace Lskj.Util
/// <param name="task"></param> /// <param name="task"></param>
public static Task<T> AddTask<T>(this Dictionary<object, Hashtable> cachesDic, object control, string key, Task<T> task) public static Task<T> AddTask<T>(this Dictionary<object, Hashtable> cachesDic, object control, string key, Task<T> task)
{ {
Hashtable cachesHash = new Hashtable(); lock (cachesDic)
if (!cachesDic.ContainsKey(control))
{ {
cachesDic.Add(control, cachesHash); Hashtable cachesHash;
} if (!cachesDic.TryGetValue(control, out cachesHash) ||
else cachesHash == null)
{ {
cachesHash = cachesDic[control]; cachesHash = new Hashtable();
cachesDic[control] = cachesHash;
} }
cachesHash.Add(key, task); cachesHash.Add(key, task);
if (task.Status == TaskStatus.Created) if (task.Status == TaskStatus.Created)
{ {
task.Start(SchedulerUtil); task.Start(SchedulerUtil);
} }
}
return task; return task;
} }