示例#1
0
    private void showWcid()
    {
        Rblcourse.Items.Clear();
        string classselect = Rblclass.SelectedValue;

        if (!string.IsNullOrEmpty(classselect))
        {
            string yearselect        = Rblyear.SelectedValue;
            string gradeselect       = Rblgrade.SelectedValue;
            string termselect        = Rblterm.SelectedValue;
            LearnSite.BLL.Works wbll = new LearnSite.BLL.Works();
            Rblcourse.DataSource     = wbll.ShowWclassWcids(Int32.Parse(yearselect), Int32.Parse(gradeselect), Int32.Parse(classselect), Int32.Parse(termselect));
            Rblcourse.DataTextField  = "Wcid";//要改为序号
            Rblcourse.DataValueField = "Wcid";
            Rblcourse.DataBind();
            int mcount = Rblcourse.Items.Count;
            if (mcount > 0)
            {
                Rblcourse.SelectedIndex = 0;
                for (int i = 0; i < mcount; i++)
                {
                    int ks = i + 1;
                    Rblcourse.Items[i].Text = ks.ToString();
                }
            }
        }
    }