/// <summary>
        /// 将检索得到所有的程序类型绑定到程序类型列表
        /// </summary>
        private void BindProgramTypeList()
        {
            B_ProgramType bllProgramType = new B_ProgramType();
            //得到所有程序类型
            DataTable dt = bllProgramType.GetAllProgramType();

            if (dt != null)
            {
                gvProgramTypeList.DataSource = dt;
                gvProgramTypeList.DataBind();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 绑定程序类型
        /// </summary>
        private void BindProgramTypes()
        {
            B_ProgramType bProType = new B_ProgramType();
            DataTable     dt       = bProType.GetAllProgramType();

            if (dt != null)
            {
                this.ddlProgramTypes.DataSource = dt;
                ddlProgramTypes.DataValueField  = "ID";
                ddlProgramTypes.DataTextField   = "Name";
                ddlProgramTypes.DataBind();
                ListItem li = new ListItem();
                li.Text  = "--请选择--";
                li.Value = "0";
                ddlProgramTypes.Items.Insert(0, li);
            }
        }
 /// <summary>
 /// 绑定DropDownList(程序类型)
 /// </summary>
 private void BindProgramType()
 {
     B_ProgramType bllProType = new B_ProgramType();
     DataTable dt = bllProType.GetAllProgramType();
     if (dt != null)
     {
         this.ddlProgramType.DataSource = dt;
         this.ddlProgramType.DataValueField = "ID";
         this.ddlProgramType.DataTextField = "Name";
         this.ddlProgramType.DataBind();
         ListItem li = new ListItem();
         li.Text = "--请选择--";
         li.Value = "0";
         this.ddlProgramType.Items.Insert(0, li);
     }
 }
 /// <summary>
 /// 将检索得到所有的程序类型绑定到程序类型列表
 /// </summary>
 private void BindProgramTypeList()
 {
     B_ProgramType bllProgramType = new B_ProgramType();
     //得到所有程序类型
     DataTable dt = bllProgramType.GetAllProgramType();
     if (dt != null)
     {
         gvProgramTypeList.DataSource = dt;
         gvProgramTypeList.DataBind();
     }
 }