using System; using System.Collections; using BP.En; using BP.Web; using BP.Difference; namespace BP.En { public enum OperatorSymbol { /// /// 大于 /// DaYu, /// /// 等于 /// DengYu, /// /// 小于 /// XiaoYu, /// /// 相似 /// Like, } /// /// 属性属性关联 /// public class AARef { /// /// 目录属性 /// public string CataAttr = null; /// /// 关联key /// public string RefKey = null; /// /// 子属性 /// public string SubAttr = null; /// /// 属性属性关联 /// /// 属性 /// /// public AARef(string cataAttr, string subAttr, string refKey) { this.CataAttr = cataAttr; this.SubAttr = subAttr; this.RefKey = refKey; } } public class AARefs : System.Collections.CollectionBase { #region 构造 public AARefs() { } public AARefs this[int index] { get { return (AARefs)this.InnerList[index]; } } #endregion #region 增加一个查询属性。 /// /// 增加一个查询属性 /// /// 标签 /// 实体的属性 /// 默认值 public void Add(string lab, string key, string refKey, string defaultSymbol, string defaultvalue, int tbWidth) { SearchNormal aos = new SearchNormal(key, lab, refKey, defaultSymbol, defaultvalue, tbWidth, false); this.InnerList.Add(aos); } #endregion } /// /// SearchKey 的摘要说明。 /// 用来处理一条记录的存放,问题。 /// public class SearchNormal { #region 基本属性 /// /// 是否隐藏 /// private bool _IsHidden = false; /// /// 是否隐藏 /// public bool ItIsHidden { get { return _IsHidden; } set { _IsHidden = value; } } /// /// 操作是否可用 /// private bool _SymbolEnable = true; /// /// 操作是否可用 /// public bool SymbolEnable { get { return _SymbolEnable; } set { _SymbolEnable = value; } } /// /// 标签 /// private string _Lab = ""; /// /// 标签 /// public string Lab { get { return _Lab; } set { _Lab = value; } } /// /// 查询默认值 /// private string _DefaultVal = ""; /// /// OperatorKey /// public string DefaultVal { get { return _DefaultVal; } set { _DefaultVal = value; } } /// /// 默认值 /// public string DefaultValRun { get { if (_DefaultVal == null) return null; if (_DefaultVal.Contains("@")) { if (_DefaultVal.Contains("@WebUser.No")) return _DefaultVal.Replace("@WebUser.No", WebUser.No); if (_DefaultVal.Contains("@WebUser.Name")) return _DefaultVal.Replace("@WebUser.Name", WebUser.Name); if (_DefaultVal.Contains("@WebUser.FK_Dept")) return _DefaultVal.Replace("@WebUser.FK_Dept", WebUser.DeptNo); if (_DefaultVal.Contains("@WebUser.DeptParentNo")) return _DefaultVal.Replace("@WebUser.DeptParentNo", WebUser.DeptParentNo); if (_DefaultVal.Contains("@WebUser.FK_DeptName")) return _DefaultVal.Replace("@WebUser.FK_DeptName", WebUser.DeptName); if (_DefaultVal.Contains("@WebUser.OrgNo")) return _DefaultVal.Replace("@WebUser.OrgNo", WebUser.OrgNo); if (_DefaultVal.Contains("@WebUser.FK_DeptNameOfFull")) return _DefaultVal.Replace("@WebUser.FK_DeptNameOfFull", WebUser.DeptNameOfFull); // 处理传递过来的参数。 //foreach (string k in System.Web.HttpContext.Current.Request.QueryString.AllKeys) //2019-07-25 zyt改造 foreach (string k in HttpContextHelper.RequestParamKeys) { if (_DefaultVal.Contains(k)) return _DefaultVal.Replace("@" + k, HttpContextHelper.RequestParams(k)); } //foreach (string k in System.Web.HttpContext.Current.Request.Form.AllKeys) //{ // if (_DefaultVal.Contains(k)) // return _DefaultVal.Replace("@" + k, System.Web.HttpContext.Current.Request.Form[k]); //} //if (_DefaultVal.Contains("@WebUser.FK_Unit")) // return _DefaultVal.Replace("@WebUser.FK_Unit", WebUser.FK_Unit); } return _DefaultVal; } } /// /// 默认的操作符号. /// private string _defaultSymbol = "="; /// /// 操作符号 /// public string DefaultSymbol { get { return _defaultSymbol; } set { _defaultSymbol = value; } } /// /// 对应的属性 /// private string _RefAttr = ""; /// /// 对应的属性 /// public string RefAttrKey { get { return _RefAttr; } set { _RefAttr = value; } } /// /// Key /// private string _Key = ""; /// /// Key /// public string Key { get { return _Key; } set { _Key = value; } } /// /// TB 宽度 /// private int _TBWidth = 10; /// /// TBWidth /// public int TBWidth { get { return _TBWidth; } set { _TBWidth = value; } } #endregion #region 构造方法 public SearchNormal() { } /// /// 构造一个普通的查询属性 /// public SearchNormal(string key, string lab, string refAttr, string DefaultSymbol, string defaultValue, int tbwidth, bool isHidden) { this.Key = key; this.Lab = lab; this.RefAttrKey = refAttr; this.DefaultSymbol = DefaultSymbol; this.DefaultVal = defaultValue; this.TBWidth = tbwidth; this.ItIsHidden = isHidden; } #endregion } /// /// SearchKey 集合 /// public class SearchNormals : System.Collections.CollectionBase { #region 构造 public SearchNormals() { } public SearchNormals this[int index] { get { return (SearchNormals)this.InnerList[index]; } } #endregion #region 增加一个查询属性。 /// /// 增加一个查询属性 /// /// 标签 /// 实体的属性 /// 默认值 public void Add(SearchNormal en) { this.InnerList.Add(en); } #endregion } }