public bool Add(EasyOne.Model.Collection.CollectionFieldRuleInfo collectionFieldRuleInfo)
        {
            string strSql = "INSERT INTO PE_CollectionFieldRules(FieldRuleId, ItemId, FieldName, FieldType, RuleType, BeginCode, EndCode, PrivateFilter, FilterRuleId, UsePaging, SpecialSetting, ExclosionID) VALUES (@FieldRuleId, @ItemId, @FieldName, @FieldType, @RuleType, @BeginCode, @EndCode, @PrivateFilter, @FilterRuleId, @UsePaging, @SpecialSetting, @ExclosionID)";

            collectionFieldRuleInfo.FieldRuleId = GetMaxId() + 1;
            return(DBHelper.ExecuteSql(strSql, GetParameters(collectionFieldRuleInfo)));
        }
 private static EasyOne.Model.Collection.CollectionFieldRuleInfo CollectionFieldRuleInfo(NullableDataReader rdr)
 {
     EasyOne.Model.Collection.CollectionFieldRuleInfo info = new EasyOne.Model.Collection.CollectionFieldRuleInfo();
     info.FieldRuleId    = rdr.GetInt32("FieldRuleId");
     info.ItemId         = rdr.GetInt32("ItemId");
     info.FieldName      = rdr.GetString("FieldName");
     info.FieldType      = rdr.GetString("FieldType");
     info.RuleType       = rdr.GetInt32("RuleType");
     info.BeginCode      = rdr.GetString("BeginCode");
     info.EndCode        = rdr.GetString("EndCode");
     info.PrivateFilter  = rdr.GetString("PrivateFilter");
     info.FilterRuleId   = rdr.GetString("FilterRuleId");
     info.UsePaging      = rdr.GetBoolean("UsePaging");
     info.SpecialSetting = rdr.GetString("SpecialSetting");
     info.ExclosionId    = rdr.GetInt32("ExclosionID");
     return(info);
 }
        private static Parameters GetParameters(EasyOne.Model.Collection.CollectionFieldRuleInfo collectionFieldRuleInfo)
        {
            Parameters parameters = new Parameters();

            parameters.AddInParameter("@FieldRuleId", DbType.Int32, collectionFieldRuleInfo.FieldRuleId);
            parameters.AddInParameter("@ItemId", DbType.Int32, collectionFieldRuleInfo.ItemId);
            parameters.AddInParameter("@FieldName", DbType.String, collectionFieldRuleInfo.FieldName);
            parameters.AddInParameter("@FieldType", DbType.String, collectionFieldRuleInfo.FieldType);
            parameters.AddInParameter("@RuleType", DbType.Int32, collectionFieldRuleInfo.RuleType);
            parameters.AddInParameter("@BeginCode", DbType.String, collectionFieldRuleInfo.BeginCode);
            parameters.AddInParameter("@EndCode", DbType.String, collectionFieldRuleInfo.EndCode);
            parameters.AddInParameter("@PrivateFilter", DbType.String, collectionFieldRuleInfo.PrivateFilter);
            parameters.AddInParameter("@FilterRuleId", DbType.String, collectionFieldRuleInfo.FilterRuleId);
            parameters.AddInParameter("@UsePaging", DbType.Boolean, collectionFieldRuleInfo.UsePaging);
            parameters.AddInParameter("@SpecialSetting", DbType.String, collectionFieldRuleInfo.SpecialSetting);
            parameters.AddInParameter("@ExclosionID", DbType.Int32, collectionFieldRuleInfo.ExclosionId);
            return(parameters);
        }
        public bool Update(EasyOne.Model.Collection.CollectionFieldRuleInfo collectionFieldRuleInfo)
        {
            string strSql = "UPDATE PE_CollectionFieldRules SET ItemId = @ItemId, FieldName = @FieldName, FieldType = @FieldType, RuleType = @RuleType, BeginCode = @BeginCode, EndCode = @EndCode, PrivateFilter = @PrivateFilter, FilterRuleId = @FilterRuleId, UsePaging = @UsePaging, SpecialSetting = @SpecialSetting, ExclosionID = @ExclosionID WHERE ItemId = @ItemId AND FieldName = @FieldName";

            return(DBHelper.ExecuteSql(strSql, GetParameters(collectionFieldRuleInfo)));
        }