Esempio n. 1
0
        /// <summary>
        /// 获取任务列表
        /// </summary>
        void GetActivateProjects()
        {
            string sql = "SELECT * FROM projects WHERE `is_activate`=1";
            IDataReader dr = DbHelper.ExecuteReader(System.Data.CommandType.Text, sql);
            projects = new List<ProjectInfo>();

            while (dr.Read())
            {
                ProjectInfo pi = new ProjectInfo();
                pi.Id = Convert.ToInt32(dr["id"]);
                pi.Name = dr["name"].ToString();
                pi.Url = dr["fetch_url"].ToString();
                pi.Charset = dr["charset"].ToString();
                pi.TotalPageCount = Convert.ToInt32(dr["total_page_count"]);
                pi.CurrentPageId = Convert.ToInt32(dr["current_page_id"]);
                pi.CurrentPostId = Convert.ToInt32(dr["current_post_id"]);
                pi.IsActivate = Convert.ToInt32(dr["is_activate"]);

                projects.Add(pi);
            }
            dr.Close();
        }
Esempio n. 2
0
        private void BindProjectList()
        {
            IDataReader dr = DbHelper.ExecuteReader(CommandType.Text, "SELECT * FROM projects");
            List<ProjectInfo> projects = new List<ProjectInfo>();
            while (dr.Read())
            {
                ProjectInfo pi = new ProjectInfo();
                pi.Id = Convert.ToInt32(dr["id"]);
                pi.Name = dr["name"].ToString();
                pi.Url = dr["fetch_url"].ToString();
                pi.Charset = dr["charset"].ToString();
                pi.TotalPageCount = Convert.ToInt32(dr["total_page_count"]);
                pi.CurrentPageId = Convert.ToInt32(dr["current_page_id"]);
                pi.CurrentPostId = Convert.ToInt32(dr["current_post_id"]);
                pi.IsActivate = Convert.ToInt32(dr["is_activate"]);

                projects.Add(pi);
            }
            dr.Close();
            this.cbbxProjects.DataSource = projects;
            this.cbbxProjects.DisplayMember = "Name";
        }