private void showTbType()
 {
     TBTypeService typeService = new TBTypeService();
     ArrayList list = typeService.GetTbTypeList();
     rptTBType.DataSource = list;
     rptTBType.DataBind();//数据源绑定
 }
Esempio n. 2
0
 private void showTypeList()
 {
     TBTypeService tbService = new TBTypeService();
     ArrayList list = tbService.GetTbTypeList();
     ddlTbType.DataSource = list;
     ddlTbType.DataTextField = "TypeIntro";
     ddlTbType.DataValueField = "Id";
     ddlTbType.DataBind();
 }
        /// <summary>
        /// 获取并设置DropDownList的数据源
        /// </summary>
        private void fillInfoType()
        {
            TBTypeService typeService = new TBTypeService();
            ArrayList list = typeService.GetTbTypeList();
            //Response.Write(list.Count);
            TBType temp = new TBType();
            temp.Id = 0;
            temp.TypeIntro = "全部信息";
            list.Insert(0, temp);

            ddlType.DataSource = list;
            ddlType.DataTextField = "TypeIntro";
            ddlType.DataValueField = "Id";
            ddlType.DataBind();
        }