Пример #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);
        }
Пример #2
0
 public bool Contains(size value)
 {
     return(List.Contains(value));
 }
Пример #3
0
 public void Remove(size value)
 {
     List.Remove(value);
 }
Пример #4
0
 public void Insert(int index, size value)
 {
     List.Insert(index, value);
 }
Пример #5
0
 public int IndexOf(size value)
 {
     return(List.IndexOf(value));
 }
Пример #6
0
 public int Add(size value)
 {
     return(List.Add(value));
 }