506 lines
22 KiB
C#
506 lines
22 KiB
C#
/******************************
|
||
* 说明:右键菜单实体类
|
||
* 创建人:龚宇超
|
||
* 创建日期:2017-10-27
|
||
* 修改人:
|
||
* 修改日期:
|
||
* 修改备注:
|
||
* 版本:1.0.0.0
|
||
******************************/
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Data;
|
||
|
||
namespace Lskj.Control.Model
|
||
{
|
||
/// <summary>
|
||
/// 右键菜单实体类
|
||
/// </summary>
|
||
public class GridRightMenuModel
|
||
{
|
||
#region private properties
|
||
private int _id;
|
||
private int _actionType;
|
||
private double _orderId;
|
||
private string _menuTabName;
|
||
private int _menuId;
|
||
private bool _maxWindow;
|
||
private bool _refresh;
|
||
private bool _dbClick;
|
||
private bool _moreClick;
|
||
private bool _mergEexec;
|
||
private string _menuName;
|
||
private string _dllName;
|
||
private string _beforeMsg;
|
||
private string _action;
|
||
private string _successMsg;
|
||
private string _errorMsg;
|
||
private string _menuCond;
|
||
private string _privilegeOper;
|
||
private bool _refreshCheckState;
|
||
private string _icoName;
|
||
private string _dllParam1;
|
||
private string _dllParam2;
|
||
private string _dllParam3;
|
||
private string _dllParam4;
|
||
private string _dllParam5;
|
||
private string _dllParam6;
|
||
private string _dllParam7;
|
||
private string _dllParam8;
|
||
private string _dllParam9;
|
||
private string _dllParam10;
|
||
private string _dllParam11;
|
||
private string _dllParam12;
|
||
private string _dllParam13;
|
||
private bool _isCopy;
|
||
private bool _isModal;
|
||
private bool _forbiddenDisplay;
|
||
private bool _noonWindow;
|
||
private bool _allowNullExec;
|
||
private string _resultSQL;
|
||
/// <summary>
|
||
/// Gets the parameter list.
|
||
/// </summary>
|
||
/// <value>The parameter list.</value>
|
||
private List<string> paramList;
|
||
#endregion
|
||
|
||
#region public properties
|
||
/// <summary>
|
||
/// <para>右键菜单执行类型</para>
|
||
/// <para>0. 执行SQL语句</para>
|
||
/// <para>1. 执行存储过程</para>
|
||
/// <para>2. 调用dll程序</para>
|
||
/// <para>3. 调用delphi程序</para>
|
||
/// </summary>
|
||
/// <value>The type of the action.</value>
|
||
public int ActionType { get { return _actionType; } }
|
||
/// <summary>
|
||
/// 右键菜单模块编号
|
||
/// </summary>
|
||
/// <value>The menuTabId.</value>
|
||
public string MenuTabName { get { return _menuTabName; } }
|
||
/// <summary>
|
||
/// 右键菜单顺序
|
||
/// </summary>
|
||
/// <value>The orderid.</value>
|
||
public double OrderId { get { return _orderId; } }
|
||
/// <summary>
|
||
/// Gets the menuid.
|
||
/// </summary>
|
||
/// <value>The menuid.</value>
|
||
public int MenuId { get { return _menuId; } }
|
||
/// <summary>
|
||
/// Gets the id.
|
||
/// </summary>
|
||
/// <value>The id.</value>
|
||
public int Id { get { return _id; } }
|
||
/// <summary>
|
||
/// 当ActionType=2时,打开dll是否最大化
|
||
/// </summary>
|
||
/// <value><c>true</c> if [maximum window]; otherwise, <c>false</c>.</value>
|
||
public bool IsModal { get { return _isModal; } }
|
||
|
||
/// <summary>
|
||
/// 当ActionType=2时,打开dll是否最大化
|
||
/// </summary>
|
||
/// <value><c>true</c> if [maximum window]; otherwise, <c>false</c>.</value>
|
||
public bool MaxWindow { get { return _maxWindow; } }
|
||
/// <summary>
|
||
/// 执行右键菜单后是否刷新表格数据
|
||
/// </summary>
|
||
/// <value><c>true</c> if refresh; otherwise, <c>false</c>.</value>
|
||
public bool Refresh { get { return _refresh; } }
|
||
/// <summary>
|
||
/// 执行右键菜单后是否重置选中状态
|
||
/// </summary>
|
||
/// <value><c>true</c> if refresh; otherwise, <c>false</c>.</value>
|
||
public bool RefreshCheckState { get { return _refreshCheckState; } }
|
||
/// <summary>
|
||
/// 表格双击时调用
|
||
/// </summary>
|
||
/// <value><c>true</c> if [database click]; otherwise, <c>false</c>.</value>
|
||
public bool DbClick { get { return _dbClick; } }
|
||
/// <summary>
|
||
/// 右键菜单是否可执行多次
|
||
/// </summary>
|
||
/// <value><c>true</c> if [more click]; otherwise, <c>false</c>.</value>
|
||
public bool MoreClick { get { return _moreClick; } }
|
||
/// <summary>
|
||
/// 右键菜单是否可执参数替换(合并)
|
||
/// </summary>
|
||
/// <value><c>true</c> if [merg Eexec]; otherwise, <c>false</c>.</value>
|
||
public bool Mergeexec { get { return _mergEexec; } }
|
||
/// <summary>
|
||
/// 菜单名称
|
||
/// </summary>
|
||
/// <value>The name of the menu.</value>
|
||
public string MenuName { get { return _menuName.Replace("\r", "").Replace("\n", ""); } }
|
||
/// <summary>
|
||
/// 调用dll名称
|
||
/// </summary>
|
||
/// <value>The name of the DLL.</value>
|
||
public string DllName
|
||
{
|
||
get
|
||
{
|
||
// 基础档案修改界面特殊处理
|
||
if ("lskj.pubadd2.dll".Equals(_dllName.Trim().ToLower()) || "lskj.pubadd3.dll".Equals(_dllName.Trim().ToLower()))
|
||
return "lskj.pubadd.dll";
|
||
return _dllName.Trim();
|
||
}
|
||
}
|
||
/// <summary>
|
||
/// 右键菜单执行前提示信息
|
||
/// </summary>
|
||
/// <value>The before MSG.</value>
|
||
public string BeforeMsg { get { return _beforeMsg; } }
|
||
/// <summary>
|
||
/// Gets the action.
|
||
/// </summary>
|
||
/// <value>The action.</value>
|
||
public string Action { get { return _action; } set { _action = value; } }
|
||
/// <summary>
|
||
/// 执行右键菜单成功后提示信息
|
||
/// </summary>
|
||
/// <value>The success MSG.</value>
|
||
public string SuccessMsg { get { return _successMsg; } }
|
||
/// <summary>
|
||
/// 执行右键菜单失败后提示信息
|
||
/// </summary>
|
||
/// <value>The error MSG.</value>
|
||
public string ErrorMsg { get { return _errorMsg; } }
|
||
/// <summary>
|
||
/// 右键菜单是否可用条件
|
||
/// </summary>
|
||
/// <value>The menu cond.</value>
|
||
public string MenuCond { get { return _menuCond; } }
|
||
/// <summary>
|
||
/// 右键菜单权限
|
||
/// </summary>
|
||
/// <value>The privilege oper.</value>
|
||
public string PrivilegeOper { get { return _privilegeOper; } }
|
||
/// <summary>
|
||
/// 扩展参数1
|
||
/// </summary>
|
||
/// <value>The DLL param1.</value>
|
||
public string DllParam1 { get { return _dllParam1; } }
|
||
/// <summary>
|
||
/// Gets the DLL param2.
|
||
/// </summary>
|
||
/// <value>The DLL param2.</value>
|
||
public string DllParam2 { get { return _dllParam2; } }
|
||
/// <summary>
|
||
/// Gets the DLL param3.
|
||
/// </summary>
|
||
/// <value>The DLL param3.</value>
|
||
public string DllParam3 { get { return _dllParam3; } }
|
||
/// <summary>
|
||
/// Gets the DLL param4.
|
||
/// </summary>
|
||
/// <value>The DLL param4.</value>
|
||
public string DllParam4 { get { return _dllParam4; } }
|
||
/// <summary>
|
||
/// Gets the DLL param5.
|
||
/// </summary>
|
||
/// <value>The DLL param5.</value>
|
||
public string DllParam5 { get { return _dllParam5; } }
|
||
/// <summary>
|
||
/// Gets the DLL param6.
|
||
/// </summary>
|
||
/// <value>The DLL param6.</value>
|
||
public string DllParam6 { get { return _dllParam6; } }
|
||
/// <summary>
|
||
/// Gets the DLL param7.
|
||
/// </summary>
|
||
/// <value>The DLL param7.</value>
|
||
public string DllParam7 { get { return _dllParam7; } }
|
||
/// <summary>
|
||
/// Gets the DLL param8.
|
||
/// </summary>
|
||
/// <value>The DLL param8.</value>
|
||
public string DllParam8 { get { return _dllParam8; } }
|
||
/// <summary>
|
||
/// Gets the DLL param9.
|
||
/// </summary>
|
||
/// <value>The DLL param9.</value>
|
||
public string DllParam9 { get { return _dllParam9; } set { _dllParam9 = value; } }
|
||
/// <summary>
|
||
/// Gets the DLL param10.
|
||
/// </summary>
|
||
/// <value>The DLL param10.</value>
|
||
public string DllParam10 { get { return _dllParam10; } }
|
||
/// <summary>
|
||
/// Gets the DLL param11.
|
||
/// </summary>
|
||
/// <value>The DLL param11.</value>
|
||
public string DllParam11 { get { return _dllParam11; } }
|
||
/// <summary>
|
||
/// Gets the DLL param12.
|
||
/// </summary>
|
||
/// <value>The DLL param12.</value>
|
||
public string DllParam12 { get { return _dllParam12; } }
|
||
/// <summary>
|
||
/// Gets the DLL param13.
|
||
/// </summary>
|
||
/// <value>The DLL param13.</value>
|
||
public string DllParam13 { get { return _dllParam13; } }
|
||
/// <summary>
|
||
/// 在mes中,是否直接执行
|
||
/// </summary>
|
||
public bool isStartRun;
|
||
/// <summary>
|
||
/// 右键后触发的post接口
|
||
/// </summary>
|
||
public string DelToPost;
|
||
/// <summary>
|
||
/// 右键后触发的post接口,获取post所需参数的sql
|
||
/// </summary>
|
||
public string DelToPostSql;
|
||
/// <summary>
|
||
/// 获取post所需参数的sql后参数存入的sql
|
||
/// </summary>
|
||
public string SynchronizationToolSQL;
|
||
/// <summary>
|
||
/// 表格操作列按钮图标名
|
||
/// </summary>
|
||
public string IcoName { get { return _icoName; } }
|
||
|
||
/// <summary>
|
||
/// 右键复制功能,把值存到剪切板中
|
||
/// </summary>
|
||
public bool isCopy { get { return _isCopy; } }
|
||
|
||
/// <summary>
|
||
/// 右键执行时弹出进度条
|
||
/// </summary>
|
||
public bool PopupProgressBar;
|
||
|
||
/// <summary>
|
||
/// 右键不满足条件是否隐藏
|
||
/// </summary>
|
||
public bool ForbiddenDisplay { get { return _forbiddenDisplay; } }
|
||
/// <summary>
|
||
/// 右键执行成功时,弹出提示框(默认弹出)
|
||
/// </summary>
|
||
public bool SuccessfulPopup = true;
|
||
/// <summary>
|
||
/// 设置是否隐藏窗体页头
|
||
/// </summary>
|
||
/// <value><c>true</c> if [noon window]; otherwise, <c>false</c>.</value>
|
||
public bool NoonWindow { get { return _noonWindow; } }
|
||
/// <summary>
|
||
/// 右键点击后默认点击搜索按钮的页签id
|
||
/// </summary>
|
||
/// <value>The title label object.</value>
|
||
public string AutomaticSearchId;
|
||
/// <summary>
|
||
/// 关联账套id
|
||
/// </summary>
|
||
/// <value>The title label object.</value>
|
||
public string UnionZTid;
|
||
/// <summary>
|
||
/// 允许不选中行执行右键
|
||
/// </summary>
|
||
public bool AllowNullExec { get { return _allowNullExec; } }
|
||
/// <summary>
|
||
/// 单据辅助功能添加保存后sql
|
||
/// </summary>
|
||
public string ResultSQL { get { return _resultSQL; } }
|
||
/// <summary>
|
||
/// 右键点击时先执行右键的序号(右键点击前先执行对应的右键)
|
||
/// </summary>
|
||
public string ExecuteFirstCode;
|
||
/// <summary>
|
||
/// 右键点击时先执行右键
|
||
/// </summary>
|
||
public GridRightMenuModel ExecuteFirstRightModel;
|
||
/// <summary>
|
||
/// 右键后最小化程序
|
||
/// </summary>
|
||
public bool DuringExecutionMinimize;
|
||
/// <summary>
|
||
/// sql直接执行模式
|
||
/// </summary>
|
||
public bool SqlDirectExecution;
|
||
/// <summary>
|
||
/// sql执行成功不提示
|
||
/// </summary>
|
||
public bool DisableSuccessfulPrompt;
|
||
/// <summary>
|
||
/// 页签名称(审核模块以页签形式打开,可以配置单据id)
|
||
/// </summary>
|
||
public string PageName;
|
||
/// <summary>
|
||
/// 右键菜单是否可用条件2(单据模块中使用。点击时实时判断主键控件是否满足条件,MenuCond之前写成了重置按钮时根据主表判断是否可以交互。)
|
||
/// </summary>
|
||
/// <value>The menu cond.</value>
|
||
public string ClickCond;
|
||
/// <summary>
|
||
/// 右键验证是否有修改后的数据
|
||
/// </summary>
|
||
public bool VerifyUpdate;
|
||
/// <summary>
|
||
/// 右键多选合并不走默认替换(p_PubPrint.lsp)
|
||
/// </summary>
|
||
public bool CancelDefaultReplace;
|
||
/// <summary>
|
||
/// 右键字体大小
|
||
/// </summary>
|
||
public int FontSize;
|
||
|
||
|
||
/// <summary>
|
||
/// 需要单独处理的exe程序
|
||
/// </summary>
|
||
/// <value>The wipe exes.</value>
|
||
public string[] WipeExes
|
||
{
|
||
get
|
||
{
|
||
return new string[] { "iexplore.exe", "lstest.exe" };
|
||
}
|
||
}
|
||
/// <summary>
|
||
/// 参数集合
|
||
/// </summary>
|
||
/// <value>The parameter list.</value>
|
||
public List<string> ParamList
|
||
{
|
||
get
|
||
{
|
||
if (paramList == null)
|
||
{
|
||
return new string[]
|
||
{
|
||
_dllParam1, _dllParam2, _dllParam3, _dllParam4, _dllParam5,
|
||
_dllParam6, _dllParam7, _dllParam8, _dllParam9, _dllParam10,
|
||
_dllParam11,_dllParam12,_dllParam13
|
||
}.ToList();
|
||
}
|
||
else
|
||
{
|
||
return this.paramList;
|
||
}
|
||
}
|
||
set
|
||
{
|
||
this.paramList = value;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// Initializes a new instance of the <see cref="GridRightMenuModel"/> class.
|
||
/// </summary>
|
||
/// <param name="item">The item.</param>
|
||
public GridRightMenuModel(DataRow item)
|
||
{
|
||
if (item == null) return;
|
||
|
||
this._id = !string.IsNullOrEmpty(item["id"] + "") ? Convert.ToInt32(item["id"]) : 0;
|
||
this._menuName = item["menuname"] + "";
|
||
if (Business.Impl.LanguageTranslation.Translatable)
|
||
{
|
||
this._menuName = Business.Impl.LanguageTranslation.GetTranslatedText(this._menuName);
|
||
}
|
||
this._dllName = "PubSpec.dll".Equals(item["dllname"] + "") ? "Lskj.PubSpec.dll" : item["dllname"] + "";
|
||
this._action = item["action"] + "";
|
||
this._actionType = string.IsNullOrWhiteSpace(item["actiontype"] + "") ? 0 : Convert.ToInt32(item["actiontype"] + "");
|
||
this._beforeMsg = item["beforeMsg"] + "";
|
||
this._successMsg = item["msgSuccess"] + "";
|
||
this._errorMsg = item["msgError"] + "";
|
||
this._orderId = string.IsNullOrWhiteSpace(item["orderid"] + "") ? 0 : Convert.ToDouble(item["orderid"] + "");
|
||
this._menuId = string.IsNullOrWhiteSpace(item["menuid"] + "") ? 0 : Convert.ToInt32(item["menuid"] + "");
|
||
this._dllParam1 = item["dllpar1"] + "";
|
||
this._dllParam2 = item["dllpar2"] + "";
|
||
this._dllParam3 = item["dllpar3"] + "";
|
||
this._dllParam4 = item["dllpar4"] + "";
|
||
this._dllParam5 = item["dllpar5"] + "";
|
||
this._dllParam6 = item["dllpar6"] + "";
|
||
this._dllParam7 = item["dllpar7"] + "";
|
||
this._dllParam8 = item["dllpar8"] + "";
|
||
this._dllParam9 = item["dllpar9"] + "";
|
||
this._dllParam10 = item["dllpar10"] + "";
|
||
this._dllParam11 = item.Table.Columns.Contains("dllpar11") ? item["dllpar11"] + "" : "";
|
||
this._dllParam12 = item.Table.Columns.Contains("dllpar12") ? item["dllpar12"] + "" : "";
|
||
this._dllParam13 = item.Table.Columns.Contains("dllpar13") ? item["dllpar13"] + "" : "";
|
||
this._menuCond = item["menuCond"] + "";
|
||
this._refreshCheckState = item.Table.Columns.Contains("refreshCheckState") && !string.IsNullOrEmpty(item["refreshCheckState"] + "") ? "1".Equals(item["refreshCheckState"] + "") : false;
|
||
|
||
if (item.Table.Columns.Contains("tab"))
|
||
this._menuTabName = item["tab"] + "";
|
||
if (item.Table.Columns.Contains("maxWindow"))
|
||
this._maxWindow = string.IsNullOrWhiteSpace(item["maxWindow"] + "") ? false : "1".Equals(item["maxWindow"] + "");
|
||
if (item.Table.Columns.Contains("ifRefresh"))
|
||
this._refresh = string.IsNullOrWhiteSpace(item["ifRefresh"] + "") ? false : "1".Equals(item["ifRefresh"] + "");
|
||
if (item.Table.Columns.Contains("privilegeOper"))
|
||
this._privilegeOper = item["privilegeOper"] + "";
|
||
if (item.Table.Columns.Contains("DbClickEvent"))
|
||
this._dbClick = string.IsNullOrWhiteSpace(item["DbClickEvent"] + "") ? false : "1".Equals(item["DbClickEvent"] + "");
|
||
if (item.Table.Columns.Contains("ifMoreClick"))
|
||
this._moreClick = string.IsNullOrWhiteSpace(item["ifMoreClick"] + "") ? false : "1".Equals(item["ifMoreClick"] + "");
|
||
if (item.Table.Columns.Contains("mergeexec"))
|
||
this._mergEexec = string.IsNullOrWhiteSpace(item["mergeexec"] + "") ? false : "1".Equals(item["mergeexec"] + "");
|
||
if (item.Table.Columns.Contains("isStartRun"))
|
||
this.isStartRun = string.IsNullOrWhiteSpace(item["isStartRun"] + "") ? false : "1".Equals(item["isStartRun"] + "");
|
||
if (item.Table.Columns.Contains("DelToPost"))
|
||
this.DelToPost = item["DelToPost"] + "";
|
||
if (item.Table.Columns.Contains("DelToPostSql"))
|
||
this.DelToPostSql = item["DelToPostSql"] + "";
|
||
if (item.Table.Columns.Contains("SynchronizationToolSQL"))
|
||
this.SynchronizationToolSQL = item["SynchronizationToolSQL"] + "";
|
||
this._icoName = item.Table.Columns.Contains("IcoName") && !string.IsNullOrEmpty(item["IcoName"] + "") ? item["IcoName"] + "" : "";
|
||
if (item.Table.Columns.Contains("isModal"))
|
||
this._isModal = string.IsNullOrWhiteSpace(item["isModal"] + "") ? false : "1".Equals(item["isModal"] + "");
|
||
if (item.Table.Columns.Contains("isCopy"))
|
||
this._isCopy = string.IsNullOrWhiteSpace(item["isCopy"] + "") ? false : "1".Equals(item["isCopy"] + "");
|
||
if (item.Table.Columns.Contains("PopupProgressBar"))
|
||
this.PopupProgressBar = string.IsNullOrWhiteSpace(item["PopupProgressBar"] + "") ? false : "1".Equals(item["PopupProgressBar"] + "");
|
||
if (item.Table.Columns.Contains("ForbiddenDisplay"))
|
||
this._forbiddenDisplay = string.IsNullOrWhiteSpace(item["ForbiddenDisplay"] + "") ? false : "1".Equals(item["ForbiddenDisplay"] + "");
|
||
if (item.Table.Columns.Contains("SuccessfulPopup"))
|
||
this.SuccessfulPopup = string.IsNullOrWhiteSpace(item["SuccessfulPopup"] + "") ? true : !"1".Equals(item["SuccessfulPopup"] + "");
|
||
if (item.Table.Columns.Contains("noonWindow"))
|
||
this._noonWindow = string.IsNullOrWhiteSpace(item["noonWindow"] + "") ? false : "1".Equals(item["noonWindow"] + "");
|
||
if (item.Table.Columns.Contains("AutomaticSearchId"))
|
||
this.AutomaticSearchId = item["AutomaticSearchId"] + "";
|
||
if (item.Table.Columns.Contains("AllowNullExec"))
|
||
this._allowNullExec = string.IsNullOrWhiteSpace(item["AllowNullExec"] + "") ? false : "1".Equals(item["AllowNullExec"] + "");
|
||
if (item.Table.Columns.Contains("ResultSQL"))
|
||
this._resultSQL = item["ResultSQL"] + "";
|
||
if (item.Table.Columns.Contains("ExecuteFirstCode"))
|
||
this.ExecuteFirstCode = item["ExecuteFirstCode"] + "";
|
||
if (item.Table.Columns.Contains("DuringExecutionMinimize"))
|
||
this.DuringExecutionMinimize = string.IsNullOrWhiteSpace(item["DuringExecutionMinimize"] + "") ? false : "1".Equals(item["DuringExecutionMinimize"] + "");
|
||
if (item.Table.Columns.Contains("SqlDirectExecution"))
|
||
this.SqlDirectExecution = string.IsNullOrWhiteSpace(item["SqlDirectExecution"] + "") ? false : "1".Equals(item["SqlDirectExecution"] + "");
|
||
if (item.Table.Columns.Contains("UnionZTid"))
|
||
this.UnionZTid = string.IsNullOrWhiteSpace(item["UnionZTid"] + "") ? "" : item["UnionZTid"] + "";
|
||
if (item.Table.Columns.Contains("DisableSuccessfulPrompt"))
|
||
this.DisableSuccessfulPrompt = string.IsNullOrWhiteSpace(item["DisableSuccessfulPrompt"] + "") ? false : "1".Equals(item["DisableSuccessfulPrompt"] + "");
|
||
if (item.Table.Columns.Contains("PageName"))
|
||
this.PageName = item["PageName"] + "";
|
||
if (item.Table.Columns.Contains("ClickCond"))
|
||
this.ClickCond = item["ClickCond"] + "";
|
||
if (item.Table.Columns.Contains("VerifyUpdate"))
|
||
this.VerifyUpdate = string.IsNullOrWhiteSpace(item["VerifyUpdate"] + "") ? false : "1".Equals(item["VerifyUpdate"] + "");
|
||
if (item.Table.Columns.Contains("CancelDefaultReplace"))
|
||
this.CancelDefaultReplace = string.IsNullOrWhiteSpace(item["CancelDefaultReplace"] + "") ? false : "1".Equals(item["CancelDefaultReplace"] + "");
|
||
|
||
this.FontSize = item.Table.Columns.Contains("FontSize") && !string.IsNullOrEmpty(item["FontSize"] + "") ? Convert.ToInt32(item["FontSize"] + "") : 0;
|
||
}
|
||
|
||
/// <summary>
|
||
///是否必须选中行
|
||
/// </summary>
|
||
/// <value><c>true</c> if this instance has must select row; otherwise, <c>false</c>.</value>
|
||
public bool IsMustSelectRow()
|
||
{
|
||
return ParamList.Contains("{") || _beforeMsg.Contains("{") || _successMsg.Contains("{") || Action.Contains("{");
|
||
}
|
||
}
|
||
}
|