public bool Add(EasyOne.Model.Collection.CollectionFilterRuleInfo collectionFilterRuleInfo) { string strSql = "INSERT INTO PE_CollectionFilterRules(FilterRuleId, FilterName, FilterType, BeginCode, EndCode, Replace) VALUES (@FilterRuleId, @FilterName, @FilterType, @BeginCode, @EndCode, @Replace)"; collectionFilterRuleInfo.FilterRuleId = GetMaxId() + 1; return(DBHelper.ExecuteSql(strSql, GetParameters(collectionFilterRuleInfo))); }
private static EasyOne.Model.Collection.CollectionFilterRuleInfo CollectionFilterRuleInfo(NullableDataReader rdr) { EasyOne.Model.Collection.CollectionFilterRuleInfo info = new EasyOne.Model.Collection.CollectionFilterRuleInfo(); info.FilterRuleId = rdr.GetInt32("FilterRuleId"); info.FilterName = rdr.GetString("FilterName"); info.FilterType = rdr.GetInt32("FilterType"); info.BeginCode = rdr.GetString("BeginCode"); info.EndCode = rdr.GetString("EndCode"); info.Replace = rdr.GetString("Replace"); return(info); }
private static Parameters GetParameters(EasyOne.Model.Collection.CollectionFilterRuleInfo collectionFilterRuleInfo) { Parameters parameters = new Parameters(); parameters.AddInParameter("@FilterRuleId", DbType.Int32, collectionFilterRuleInfo.FilterRuleId); parameters.AddInParameter("@FilterName", DbType.String, collectionFilterRuleInfo.FilterName); parameters.AddInParameter("@FilterType", DbType.Int32, collectionFilterRuleInfo.FilterType); parameters.AddInParameter("@BeginCode", DbType.String, collectionFilterRuleInfo.BeginCode); parameters.AddInParameter("@EndCode", DbType.String, collectionFilterRuleInfo.EndCode); parameters.AddInParameter("@Replace", DbType.String, collectionFilterRuleInfo.Replace); return(parameters); }
public bool Update(EasyOne.Model.Collection.CollectionFilterRuleInfo collectionFilterRuleInfo) { string strSql = "UPDATE PE_CollectionFilterRules SET FilterRuleId = @FilterRuleId, FilterName = @FilterName, FilterType = @FilterType, BeginCode = @BeginCode, EndCode = @EndCode, Replace = @Replace WHERE FilterRuleId = @FilterRuleId"; return(DBHelper.ExecuteSql(strSql, GetParameters(collectionFilterRuleInfo))); }