public List <ImgType> ImgType_GetByAll() { List <Data.ImgType> list = new List <Data.ImgType>(); using (SqlCommand dbCmd = new SqlCommand("sp_ImgType_GetByAll", GetConnection())) { Data.ImgType obj = new Data.ImgType(); dbCmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = dbCmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { list.Add(obj.ImagesTypeIDataReader(dr)); } } dr.Close(); obj = null; } return(list); }
public List <ImgType> ImgType_GetByTop(string Top, string Where, string Order) { List <Data.ImgType> list = new List <Data.ImgType>(); using (SqlCommand dbCmd = new SqlCommand("sp_ImgType_GetByTop", GetConnection())) { Data.ImgType obj = new Data.ImgType(); 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.ImagesTypeIDataReader(dr)); } } dr.Close(); obj = null; } return(list); }