feat: 更新业务及控件功能
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -692,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);
|
||||||
@@ -712,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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5536,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;
|
||||||
@@ -5580,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;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -1047,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;
|
||||||
@@ -3553,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)
|
||||||
|
|||||||
@@ -786,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;
|
||||||
@@ -1443,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>
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user