Esempio n. 1
0
 public bool Contains(ct value)
 {
     return(List.Contains(value));
 }
Esempio n. 2
0
 public void Remove(ct value)
 {
     List.Remove(value);
 }
Esempio n. 3
0
 public void Insert(int index, ct value)
 {
     List.Insert(index, value);
 }
Esempio n. 4
0
 public int IndexOf(ct value)
 {
     return(List.IndexOf(value));
 }
Esempio n. 5
0
 public int Add(ct value)
 {
     return(List.Add(value));
 }
Esempio n. 6
0
        /// Lấy tất cả đối tượng
        ///
        ///</summary>
        public ctCollection Getlist(string sTextSearch)
        {
            Data objData;

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

            try
            {
                if (objData.GetConnection() == null || objData.GetConnection().State == ConnectionState.Closed)
                {
                    objData.Connect();
                }
                objData.CreateNewStoredProcedure("sproc_Contents_Get");
                objData.AddParameter("@TextSearch", sTextSearch);
                IDataReader reader = objData.ExecStoreToDataReader();
                while (reader.Read())
                {
                    if (col == null)
                    {
                        col = new ctCollection();
                    }
                    ct obj = new ct();

                    if (!Convert.IsDBNull(reader["ID"]))
                    {
                        obj.ID = Convert.ToString(reader["ID"]);
                    }
                    if (!Convert.IsDBNull(reader["Title"]))
                    {
                        obj.Title = Convert.ToString(reader["Title"]);
                    }
                    if (!Convert.IsDBNull(reader["Detail"]))
                    {
                        obj.Detail = Convert.ToString(reader["Detail"]);
                    }
                    col.Add(obj);
                }
                reader.Close();
                reader.Dispose();
            }
            catch (Exception objEx)
            {
                throw new Exception("Getlist() Error   " + objEx.Message.ToString());
            }
            finally
            {
                if (objDataAccess == null)
                {
                    objData.DeConnect();
                }
            }
            return(col);
        }