public List <Mod> Mod_GetById(string Id) { List <Data.Mod> list = new List <Mod>(); using (SqlCommand dbCmd = new SqlCommand("sp_Mod_GetById", GetConnection())) { Data.Mod obj = new Data.Mod(); dbCmd.CommandType = CommandType.StoredProcedure; dbCmd.Parameters.Add(new SqlParameter("@Id", Id)); SqlDataReader dr = dbCmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { list.Add(obj.ModIDataReader(dr)); } } dr.Close(); obj = null; } return(list); }
public List <Mod> Mod_GetByType(string Top, string Where, string Order) { List <Data.Mod> list = new List <Mod>(); using (SqlCommand dbCmd = new SqlCommand("sp_Mod_GetByType", GetConnection())) { Data.Mod obj = new Data.Mod(); dbCmd.CommandType = CommandType.StoredProcedure; dbCmd.Parameters.Add(new SqlParameter("@Top", Top)); dbCmd.Parameters.Add(new SqlParameter("@Where", Where)); dbCmd.Parameters.Add(new SqlParameter("@Order", Order)); SqlDataReader dr = dbCmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { list.Add(obj.ModIDataReader(dr)); } dr.Close(); obj = null; } return(list); } }