Exemplo n.º 1
0
        ///<summary>
        /// Lấy tất cả đối tượng
        ///
        ///</summary>
        public sizeCollection GetAll()
        {
            Data objData;

            if (objDataAccess == null)
            {
                objData = new Data();
            }
            else
            {
                objData = objDataAccess;
            }
            sizeCollection col = null;

            try
            {
                if (objData.GetConnection() == null || objData.GetConnection().State == ConnectionState.Closed)
                {
                    objData.Connect();
                }
                objData.CreateNewStoredProcedure("size_Getlist");
                IDataReader reader = objData.ExecStoreToDataReader();
                while (reader.Read())
                {
                    if (col == null)
                    {
                        col = new sizeCollection();
                    }
                    size obj = new size();
                    if (!Convert.IsDBNull(reader["ID"]))
                    {
                        obj.ID = Convert.ToInt32(reader["ID"]);
                    }
                    if (!Convert.IsDBNull(reader["Width"]))
                    {
                        obj.Width = Convert.ToString(reader["Width"]);
                    }
                    if (!Convert.IsDBNull(reader["Height"]))
                    {
                        obj.Height = Convert.ToString(reader["Height"]);
                    }

                    col.Add(obj);
                }
                reader.Close();
                reader.Dispose();
            }
            catch (Exception objEx)
            {
                throw new Exception("GetAll() Error   " + objEx.Message.ToString());
            }
            finally
            {
                if (objDataAccess == null)
                {
                    objData.DeConnect();
                }
            }
            return(col);
        }
Exemplo n.º 2
0
 public bool Contains(size value)
 {
     return(List.Contains(value));
 }
Exemplo n.º 3
0
 public void Remove(size value)
 {
     List.Remove(value);
 }
Exemplo n.º 4
0
 public void Insert(int index, size value)
 {
     List.Insert(index, value);
 }
Exemplo n.º 5
0
 public int IndexOf(size value)
 {
     return(List.IndexOf(value));
 }
Exemplo n.º 6
0
 public int Add(size value)
 {
     return(List.Add(value));
 }