Пример #1
0
        public bool DeleteCollect(CollectStruct info)
        {
            bool          isSuccess = true;
            string        sql       = "delete from collect where name='" + info.Name + "' and url='" + info.Href + "'";
            SQLiteCommand command   = new SQLiteCommand(sql, m_connect);

            command.ExecuteNonQuery();
            return(isSuccess);
        }
Пример #2
0
        public CollectStruct SearchCollectByName(string name, string url)
        {
            CollectStruct collectInfo;

            collectInfo = new CollectStruct();
            string        sql     = "select * from collect where name='" + name + "' and url='" + url + "'";
            SQLiteCommand command = new SQLiteCommand(sql, m_connect);
            var           reader  = command.ExecuteReader();

            collectInfo = new CollectStruct();

            while (reader.Read())
            {
                collectInfo.Href      = reader["url"].ToString();
                collectInfo.Name      = reader["name"].ToString();
                collectInfo.ImagePath = reader["imagePath"].ToString();
            }

            return(collectInfo);
        }
Пример #3
0
        public List <CollectStruct> GetCollet()
        {
            CollectStruct        collectInfo;
            List <CollectStruct> list;

            list = new List <CollectStruct>();
            string        commandText = "select * from collect";
            SQLiteCommand command     = m_connect.CreateCommand();

            command.CommandText = commandText;
            var reader = command.ExecuteReader();

            while (reader.Read())
            {
                collectInfo           = new CollectStruct();
                collectInfo.Href      = reader["url"].ToString();
                collectInfo.Name      = reader["name"].ToString();
                collectInfo.ImagePath = reader["imagePath"].ToString();
                list.Add(collectInfo);
            }
            return(list);
        }