SVN r1104
SVN-Revision: r1104
This commit is contained in:
@@ -464,7 +464,51 @@ namespace Lskj.Control
|
||||
|
||||
}
|
||||
this.ddb_common.Visible = tableCommon != null && tableCommon.Rows.Count > 0;
|
||||
this.ddb_common.Click += Ddb_common_Click;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断常用工具中的条件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Ddb_common_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (BarItemLink itemLink in this.pm_common.ItemLinks)
|
||||
{
|
||||
DataRow rowItem = itemLink.Item.Tag as DataRow;
|
||||
if (rowItem != null&& rowItem.Table.Columns.Contains("MenuCond"))
|
||||
{
|
||||
string menuCond = rowItem["MenuCond"] + "";
|
||||
string menuCaption = itemLink.Caption;
|
||||
|
||||
if (!string.IsNullOrEmpty(menuCond))
|
||||
{
|
||||
try
|
||||
{
|
||||
bool result = true;
|
||||
menuCond = this.ControlObj.ReplaceControlValue(menuCond);
|
||||
if (menuCond.StartsWith("@") || menuCond.StartsWith("!"))
|
||||
{
|
||||
result = "1".Equals(BaseImpl.GetDefaultValue(menuCond));
|
||||
}
|
||||
else
|
||||
{
|
||||
result = ReplaceHelper.EvalCond(menuCond);
|
||||
}
|
||||
itemLink.Item.Enabled = result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show("[" + menuCaption + "] " + ResourceKeys.SetRightMenuCondFault);
|
||||
LogHelper.Instance.WriteError(ex);
|
||||
LogUtil.WriteError("验证可操作条件出错!", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:常用工具点击</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
@@ -2060,6 +2104,20 @@ namespace Lskj.Control
|
||||
try
|
||||
{
|
||||
DataRow rowItem = e.Item.Tag as DataRow;
|
||||
GridRightMenuModel model = new GridRightMenuModel(rowItem);
|
||||
//if (!string.IsNullOrWhiteSpace(model.MenuCond))
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// string cond = this.ControlObj.ReplaceControlValue(model.MenuCond);
|
||||
// bool result = ReplaceHelper.EvalCond(cond);
|
||||
// if (!result) return;
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
// MessageUtil.Show(ResourceKeys.SetRightMenuCondFault);
|
||||
// }
|
||||
//}
|
||||
|
||||
CommonMenu menu = new CommonMenu(this.Model, this.ControlObj);
|
||||
menu.Apply(rowItem);
|
||||
|
||||
Reference in New Issue
Block a user