Example #1
0
        public List <GroupImages> GroupImages_GetByTop(string Top, string Where, string Order)
        {
            List <Data.GroupImages> list = new List <Data.GroupImages>();

            Data.GroupImages obj = new Data.GroupImages();
            SqlDataReader    dr  = null;

            try
            {
                using (SqlCommand dbCmd = new SqlCommand("sp_GroupImages_GetByTop", GetConnection()))
                {
                    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));
                    dr = dbCmd.ExecuteReader();
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            list.Add(obj.GroupImagesIDataReader(dr));
                        }
                        //conn.Close();
                    }
                }
            }
            catch (Exception)
            {
            }
            finally
            {
                if (dr != null)
                {
                    dr.Close();
                }
                obj = null;
            }
            return(list);
        }
Example #2
0
        public List <GroupImages> GroupImages_GetByAll()
        {
            List <Data.GroupImages> list = new List <Data.GroupImages>();

            Data.GroupImages obj = new Data.GroupImages();
            SqlDataReader    dr  = null;

            try
            {
                using (SqlCommand dbCmd = new SqlCommand("sp_GroupImages_GetByAll", GetConnection()))
                {
                    dbCmd.CommandType = CommandType.StoredProcedure;
                    dr = dbCmd.ExecuteReader();
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            list.Add(obj.GroupImagesIDataReader(dr));
                        }
                        //conn.Close();
                    }
                }
            }
            catch (Exception)
            {
            }
            finally
            {
                if (dr != null)
                {
                    dr.Close();
                }
                obj = null;
            }
            return(list);
        }