SVN-Revision: r497
This commit is contained in:
wyf
2025-04-18 04:02:51 +00:00
parent 7ec84b9d3b
commit 4f4b091c78
3 changed files with 102 additions and 208 deletions
@@ -123,57 +123,20 @@ namespace Lskj.Control.Model.MenuStrip
GridRightMenuModel model = cms.Tag as GridRightMenuModel;
if (model != null)
{
if (model.PrivilegeOper.Length > 1 && !model.PrivilegeOper.Contains(ERPInfo.Instance.UserName + ","))
if (!string.IsNullOrWhiteSpace(model.MenuCond))
{
if (model.ForbiddenDisplay)
try
{
cms.Visible = false;
}
cms.Enabled = false;
}
else
{
if (!string.IsNullOrWhiteSpace(model.MenuCond))
{
try
string cond = string.Empty;
if (this._control != null)
cond = _control.ReplaceParentControlValue(model.MenuCond);
cond = ReplaceHelper.ReplaceRowParam(mSelectRow, model.MenuCond);
if (this._treeView != null)
{
string cond = string.Empty;
if (this._control != null)
cond = _control.ReplaceParentControlValue(model.MenuCond);
cond = ReplaceHelper.ReplaceRowParam(mSelectRow, model.MenuCond);
if (this._treeView != null)
List<TreeListCell> cells = this._treeView.GetSelectedCells();
if (cells != null && cells.Count > 0 && cond.Contains("{COLUMN_"))
{
List<TreeListCell> cells = this._treeView.GetSelectedCells();
if (cells != null && cells.Count > 0 && cond.Contains("{COLUMN_"))
{
TreeListCell cell = cells[0];
DataRow focusedRow = this.BaseGridView.GetFocusedDataRow();
string colValue = focusedRow == null || !focusedRow.Table.Columns.Contains(cell.Column.Name) ? "" : focusedRow[cell.Column.Name] + "";
cond = cond.ReplaceColumnParam(cell.Column.Name, cell.Column.Caption, colValue);
}
}
if (ControlObj != null)
cond = ControlObj.ReplaceParentControlValue(cond);
//cms.Enabled = ReplaceHelper.EvalCond(cond);
if (model.ForbiddenDisplay)
{
cms.Visible = ValidateCond(cond, null);
}
cms.Enabled = ValidateCond(cond, null); ;
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(ResourceKeys.SetRightMenuCondFault + "\r\n" + Message);
break;
}
}
}
}
}
}
}
}
TreeListCell cell = cells[0];
DataRow focusedRow = this.BaseGridView.GetFocusedDataRow();
string colValue = focusedRow == null || !focusedRow.Table.Columns.Contains(cell.Column.Name) ? "" : focusedRow[cell.Column.Name] + "";
cond = cond.ReplaceColumnParam(