Exemplo n.º 1
0
        public static RecommendInfo GetRecommendInfoEntity(IDataReader reader)
        {
            if (reader.Read())
            {
                RecommendInfo rinfo = new RecommendInfo();

                rinfo.id = TypeConverter.ObjectToInt(reader["id"].ToString());
                rinfo.ctitle = reader["ctitle"].ToString();
                rinfo.ctype = TypeConverter.ObjectToInt(reader["ctype"].ToString());
                rinfo.relatechanel = TypeConverter.ObjectToInt(reader["relatechanel"].ToString());
                rinfo.relatecategory = TypeConverter.ObjectToInt(reader["relatecategory"].ToString());
                rinfo.ccontent = reader["ccontent"].ToString();
                rinfo.createdatetime = reader["createdatetime"].ToString();
                rinfo.updatedatetime = reader["updatedatetime"].ToString();

                reader.Close();
                return rinfo;
            }
            return null;
        }
Exemplo n.º 2
0
 public static List<RecommendInfo> GetRecommendListEntity(IDataReader reader)
 {
     List<RecommendInfo> rinfolist = new List<RecommendInfo>();
     while (reader.Read())
     {
         RecommendInfo rinfo = new RecommendInfo();
         rinfo.id = TypeConverter.ObjectToInt(reader["id"].ToString());
         rinfo.ctitle = reader["ctitle"].ToString();
         rinfo.ctype = TypeConverter.ObjectToInt(reader["ctype"].ToString());
         rinfo.relatechanel = TypeConverter.ObjectToInt(reader["relatechanel"].ToString());
         rinfo.relatecategory = TypeConverter.ObjectToInt(reader["relatecategory"].ToString());
         rinfo.ccontent = reader["ccontent"].ToString();
         rinfo.createdatetime = reader["createdatetime"].ToString();
         rinfo.updatedatetime = reader["updatedatetime"].ToString();
         rinfolist.Add(rinfo);
     }
     reader.Close();
     return rinfolist;
 }
        private void InitializeComponent()
        {
            EditRecommendInfo.Click += new EventHandler(EditRecommendInfo_Click);

            TaoChanel ete = new TaoChanel();
            rchanel.Items.Clear();
            foreach (string cname in Enum.GetNames(ete.GetType()))
            {
                int s_value = Convert.ToInt16(Enum.Parse(ete.GetType(), cname));
                string s_text = EnumCatch.GetTaoChanel(s_value);
                rchanel.Items.Add(new ListItem(s_text, s_value.ToString()));
            }

            rcategory.BuildTree(tpb.GetAllCategoryList(), "name", "cid");
            rinfo = tpb.GetRecommendInfo(rid);
        }