public GBCategoryInfo GetDataById(int gbc_id) { GBCategoryInfo info = new GBCategoryInfo(); IDataReader reader = db.GetDataById(gbc_id).CreateDataReader(); if (reader.Read()) { info = GBCategoryInfo.Populate(reader); } return(info); }
public List <GBCategoryInfo> GetDataBySort(int sort) { List <GBCategoryInfo> infos = new List <GBCategoryInfo>(); IDataReader reader = db.GetDataBySort(sort).CreateDataReader(); while (reader.Read()) { infos.Add(GBCategoryInfo.Populate(reader)); } return(infos); }
public int InsertSorting() { GBCategoryInfo info = new GBCategoryInfo(); IDataReader reader = db.InsertSorting().CreateDataReader(); if (reader.Read()) { info = GBCategoryInfo.Populate(reader); return(info.gbc_sort + 1); } return(1); }