예제 #1
0
        /// <summary>
        /// 根据文件栏目id得到栏目实体
        /// </summary>
        /// <param name="download_col_id"></param>
        /// <returns></returns>
        public YouthDownloadColumn GetDownloadsColById(int download_col_id)
        {
            StringBuilder str = new StringBuilder();

            str.Append("select ");
            str.Append("download_column_id, download_column_name ");
            str.Append(" from downloads_column ");
            str.Append(" where download_column_id=" + download_col_id);
            YouthDownloadColumn model = new YouthDownloadColumn();
            DataSet             ds    = DbHelperSQL.Query(str.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                model.Download_column_id   = Convert.ToInt32(row["download_column_id"].ToString());
                model.Download_column_name = row["download_column_name"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
 protected void bindDownloadCol()
 {
     download_col      = download_col_bll.GetDownloadsColById(download_col_id);
     download_col_name = download_col.Download_column_name;
 }