//验证合法性 public bool ValidateColumnRange(string ids, ColumnShowType ColumnShowType, int tabletypeid) { bool result = true; using (IFMPDBContext db = new IFMPDBContext()) { List <int> idlist = new List <int>(ids.Split(',').Select(t => { int m = Convert.ToInt32(t); return(m); })); List <TableColumn> TableColumnList = db.TableColumn.Where(t => idlist.Contains(t.ID)).ToList(); List <Dictionary> DictionaryList = db.Dictionary.ToList(); if (ColumnShowType == ColumnShowType.极值 || ColumnShowType == ColumnShowType.平均值 || ColumnShowType == ColumnShowType.最大值 || ColumnShowType == ColumnShowType.最小值 || ColumnShowType == ColumnShowType.求和) { DictionaryList = DictionaryList.Where(t => t.RegexType == RegexType.非负整数 || t.RegexType == RegexType.实数 || t.RegexType == RegexType.范围的数字 || t.RegexType == RegexType.整数 || t.RegexType == RegexType.正整数 ).ToList(); if (TableColumnList.Count != TableColumnList.Where(t => DictionaryList.Select(m => m.ID).Contains(t.DictionaryID.Value)).Count()) { result = false; } } } return(result); }
/// <summary> /// 绑定字段并自定义方法进行处理 /// </summary> /// <param name="_KeyName">字段名称</param> /// <param name="_ValueToUserInfoHandle">需要绑定的委托</param> /// <param name="_KeyColumnShowType">显示类型</param> public UserEval(string _KeyName, ValueToUserInfo _ValueToUserInfoHandle, ColumnShowType _KeyColumnShowType) { KeyName = _KeyName; ValueToUserInfoHandle = _ValueToUserInfoHandle; KeyColumnShow = _KeyColumnShowType; }
/// <summary> /// 绑定字段并进行处理 /// </summary> /// <param name="_KeyName">字段名称</param> /// <param name="_KeyValueToUser">用于处理的字符串例如index?id=[value]程序自动将[value]替换为该字段的值</param> /// <param name="_KeyColumnShowType">显示类型</param> public UserEval(string _KeyName, string _KeyValueToUser, ColumnShowType _KeyColumnShowType) { KeyName = _KeyName; KeyValueToUser = _KeyValueToUser; KeyColumnShow = _KeyColumnShowType; }
/// <summary> /// 绑定字段 /// </summary> /// <param name="_KeyName">字段名称</param> /// <param name="_KeyColumnShowType">显示类型</param> public UserEval(string _KeyName, ColumnShowType _KeyColumnShowType) { KeyName = _KeyName; KeyColumnShow = _KeyColumnShowType; }