/****************************** * 说明:右键菜单实体类 * 创建人:龚宇超 * 创建日期: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 { /// /// 右键菜单实体类 /// 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 bool _isCopy; private bool _isModal; private bool _forbiddenDisplay; private bool _noonWindow; private bool _allowNullExec; private string _resultSQL; /// /// Gets the parameter list. /// /// The parameter list. private List paramList; #endregion #region public properties /// /// 右键菜单执行类型 /// 0. 执行SQL语句 /// 1. 执行存储过程 /// 2. 调用dll程序 /// 3. 调用delphi程序 /// /// The type of the action. public int ActionType { get { return _actionType; } } /// /// 右键菜单模块编号 /// /// The menuTabId. public string MenuTabName { get { return _menuTabName; } } /// /// 右键菜单顺序 /// /// The orderid. public double OrderId { get { return _orderId; } } /// /// Gets the menuid. /// /// The menuid. public int MenuId { get { return _menuId; } } /// /// Gets the id. /// /// The id. public int Id { get { return _id; } } /// /// 当ActionType=2时,打开dll是否最大化 /// /// true if [maximum window]; otherwise, false. public bool IsModal { get { return _isModal; } } /// /// 当ActionType=2时,打开dll是否最大化 /// /// true if [maximum window]; otherwise, false. public bool MaxWindow { get { return _maxWindow; } } /// /// 执行右键菜单后是否刷新表格数据 /// /// true if refresh; otherwise, false. public bool Refresh { get { return _refresh; } } /// /// 执行右键菜单后是否重置选中状态 /// /// true if refresh; otherwise, false. public bool RefreshCheckState { get { return _refreshCheckState; } } /// /// 表格双击时调用 /// /// true if [database click]; otherwise, false. public bool DbClick { get { return _dbClick; } } /// /// 右键菜单是否可执行多次 /// /// true if [more click]; otherwise, false. public bool MoreClick { get { return _moreClick; } } /// /// 右键菜单是否可执参数替换 /// /// true if [merg Eexec]; otherwise, false. public bool Mergeexec { get { return _mergEexec; } } /// /// 菜单名称 /// /// The name of the menu. public string MenuName { get { return _menuName.Replace("\r", "").Replace("\n", ""); } } /// /// 调用dll名称 /// /// The name of the DLL. 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(); } } /// /// 右键菜单执行前提示信息 /// /// The before MSG. public string BeforeMsg { get { return _beforeMsg; } } /// /// Gets the action. /// /// The action. public string Action { get { return _action; } set { _action = value; } } /// /// 执行右键菜单成功后提示信息 /// /// The success MSG. public string SuccessMsg { get { return _successMsg; } } /// /// 执行右键菜单失败后提示信息 /// /// The error MSG. public string ErrorMsg { get { return _errorMsg; } } /// /// 右键菜单是否可用条件 /// /// The menu cond. public string MenuCond { get { return _menuCond; } } /// /// 右键菜单权限 /// /// The privilege oper. public string PrivilegeOper { get { return _privilegeOper; } } /// /// 扩展参数1 /// /// The DLL param1. public string DllParam1 { get { return _dllParam1; } } /// /// Gets the DLL param2. /// /// The DLL param2. public string DllParam2 { get { return _dllParam2; } } /// /// Gets the DLL param3. /// /// The DLL param3. public string DllParam3 { get { return _dllParam3; } } /// /// Gets the DLL param4. /// /// The DLL param4. public string DllParam4 { get { return _dllParam4; } } /// /// Gets the DLL param5. /// /// The DLL param5. public string DllParam5 { get { return _dllParam5; } } /// /// Gets the DLL param6. /// /// The DLL param6. public string DllParam6 { get { return _dllParam6; } } /// /// Gets the DLL param7. /// /// The DLL param7. public string DllParam7 { get { return _dllParam7; } } /// /// Gets the DLL param8. /// /// The DLL param8. public string DllParam8 { get { return _dllParam8; } } /// /// Gets the DLL param9. /// /// The DLL param9. public string DllParam9 { get { return _dllParam9; } set { _dllParam9 = value; } } /// /// Gets the DLL param10. /// /// The DLL param10. public string DllParam10 { get { return _dllParam10; } } /// /// Gets the DLL param11. /// /// The DLL param11. public string DllParam11 { get { return _dllParam11; } } /// /// Gets the DLL param12. /// /// The DLL param12. public string DllParam12 { get { return _dllParam12; } } /// /// 在mes中,是否直接执行 /// public bool isStartRun; /// /// 右键后触发的post接口 /// public string DelToPost; /// /// 右键后触发的post接口,获取post所需参数的sql /// public string DelToPostSql; /// /// 获取post所需参数的sql后参数存入的sql /// public string SynchronizationToolSQL; /// /// 表格操作列按钮图标名 /// public string IcoName { get { return _icoName; } } /// /// 右键复制功能,把值存到剪切板中 /// public bool isCopy { get { return _isCopy; } } /// /// 右键执行时弹出进度条 /// public bool PopupProgressBar; /// /// 右键不满足条件是否隐藏 /// public bool ForbiddenDisplay { get { return _forbiddenDisplay; } } /// /// 右键执行成功时,弹出提示框(默认弹出) /// public bool SuccessfulPopup = true; /// /// 设置是否隐藏窗体页头 /// /// true if [noon window]; otherwise, false. public bool NoonWindow { get { return _noonWindow; } } /// /// 右键点击后默认点击搜索按钮的页签id /// /// The title label object. public string AutomaticSearchId; /// /// 关联账套id /// /// The title label object. public string UnionZTid; /// /// 允许不选中行执行右键 /// public bool AllowNullExec { get { return _allowNullExec; } } /// /// 单据辅助功能添加保存后sql /// public string ResultSQL { get { return _resultSQL; } } /// /// 右键点击时先执行右键的序号(右键点击前先执行对应的右键) /// public string ExecuteFirstCode; /// /// 右键点击时先执行右键 /// public GridRightMenuModel ExecuteFirstRightModel; /// /// 右键后最小化程序 /// public bool DuringExecutionMinimize; /// /// sql直接执行模式 /// public bool SqlDirectExecution; /// /// 需要单独处理的exe程序 /// /// The wipe exes. public string[] WipeExes { get { return new string[] { "iexplore.exe", "lstest.exe" }; } } /// /// 参数集合 /// /// The parameter list. public List ParamList { get { if (paramList == null) { return new string[] { _dllParam1, _dllParam2, _dllParam3, _dllParam4, _dllParam5, _dllParam6, _dllParam7, _dllParam8, _dllParam9, _dllParam10, _dllParam11,_dllParam12 }.ToList(); } else { return this.paramList; } } set { this.paramList = value; } } #endregion /// /// Initializes a new instance of the class. /// /// The item. 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._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