Exemplo n.º 1
0
        public void BindData()
        {
            peixunban_id = Request.QueryString["peixunban_id"];

            Maticsoft.BLL.peixunban1 bll = new Maticsoft.BLL.peixunban1();
            DataSet       ds             = new DataSet();
            StringBuilder strWhere       = new StringBuilder();

            strWhere.Append("id=" + peixunban_id);
            ds          = bll.GetList(strWhere.ToString());
            Label1.Text = ds.Tables[0].Rows[0]["name"].ToString();
            //DropDownList1.DataSource = ds;
            //DropDownList1.DataTextField = "name";
            //DropDownList1.DataValueField = "id";
            //DropDownList1.DataBind();
            //DropDownList1.SelectedValue = peixunban_id.ToString();

            Maticsoft.BLL.kecheng_neirong bll2 = new BLL.kecheng_neirong();
            DataSet ds2 = new DataSet();

            ds2 = bll2.GetList("");
            DropDownList2.DataSource     = ds2;
            DropDownList2.DataTextField  = "name";
            DropDownList2.DataValueField = "id";
            DropDownList2.DataBind();

            Maticsoft.BLL.teacher bll3 = new BLL.teacher();
            DataSet ds3 = new DataSet();

            ds3 = bll3.GetList("");
            DropDownList3.DataSource     = ds3;
            DropDownList3.DataTextField  = "name";
            DropDownList3.DataValueField = "id";
            DropDownList3.DataBind();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取培训班信息、课程内容信息,绑定两个下拉框
        /// </summary>
        public void BindData()
        {
            Maticsoft.BLL.peixunban1 bll = new Maticsoft.BLL.peixunban1();
            DataSet       ds             = new DataSet();
            StringBuilder strWhere       = new StringBuilder();

            strWhere.Append("[start_time] < '");
            strWhere.Append(DateTime.Today.AddDays(30).Date.ToShortDateString());
            strWhere.Append("' and [end_time] > '");
            strWhere.Append(DateTime.Today.AddDays(-30).Date.ToShortDateString());
            strWhere.Append("'");
            ds = bll.GetList(strWhere.ToString());
            qishu.DataSource     = ds;
            qishu.DataTextField  = "name";
            qishu.DataValueField = "id";
            qishu.DataBind();

            Maticsoft.BLL.kecheng_neirong bll2 = new BLL.kecheng_neirong();
            DataSet ds2 = new DataSet();

            ds2 = bll2.GetList("");
            kecheng.DataSource     = ds2;
            kecheng.DataTextField  = "name";
            kecheng.DataValueField = "id";
            kecheng.DataBind();


            fen_zu(Convert.ToInt16(qishu.SelectedValue));
            ke_cheng(Convert.ToInt16(qishu.SelectedValue));


            if (Session["shangke_vie"] != null)
            {
                Session["shangke_vie"] = null;
            }
        }