Example #1
0
    protected void DataListGroup_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        int          sgrade  = Int32.Parse(Request.QueryString["Sg"].ToString());
        int          sclass  = Int32.Parse(Request.QueryString["Sc"].ToString());
        string       sid     = ((Label)e.Item.FindControl("LabelSid")).Text;
        Label        lbgstus = (Label)e.Item.FindControl("LabelGstus");
        DropDownList ddl     = (DropDownList)e.Item.FindControl("DDLGscores");
        LinkButton   btnview = (LinkButton)e.Item.FindControl("LinkBtnView");

        LearnSite.BLL.Students sbll = new LearnSite.BLL.Students();
        lbgstus.Text = sbll.GroupMember(sgrade, sclass, int.Parse(sid));
        string snum = ((Label)e.Item.FindControl("LabelSnum")).Text;
        int    mid  = Int32.Parse(Request.QueryString["Mi"].ToString());

        LearnSite.BLL.GroupWork   gbll   = new LearnSite.BLL.GroupWork();
        LearnSite.Model.GroupWork gmodel = new LearnSite.Model.GroupWork();
        gmodel = gbll.GetModelBySnum(snum, mid);
        if (gmodel != null)
        {
            ddl.SelectedValue       = gmodel.Gscore.ToString();
            ddl.ToolTip             = gmodel.Gid.ToString();
            btnview.CommandArgument = gmodel.Gurl;
        }
        else
        {
            ddl.SelectedValue = "0";
            ddl.Enabled       = false;
            btnview.Enabled   = false;
        }
    }
Example #2
0
    private void showGroupWork()
    {
        int groupcount = DLgroups.Items.Count;
        int pos        = Int32.Parse(Labelpos.Text);
        int lastpos    = Int32.Parse(Labellastpos.Text);

        if (groupcount > 0 && pos > -1 && pos < groupcount)
        {
            int        sgrade = Int32.Parse(Request.QueryString["Sg"].ToString());
            int        sclass = Int32.Parse(Request.QueryString["Sc"].ToString());
            int        mid    = Int32.Parse(Request.QueryString["Mi"].ToString());
            LinkButton lb     = (LinkButton)DLgroups.Items[pos].FindControl("LbSgtitle");
            LabelSgtitle.Text = lb.Text;
            lb.BorderColor    = System.Drawing.Color.FromArgb(0, 102, 255);
            if (pos != lastpos)
            {
                LinkButton lblast = (LinkButton)DLgroups.Items[lastpos].FindControl("LbSgtitle");
                lblast.BorderColor = System.Drawing.Color.FromArgb(212, 212, 212);//还原上个边框颜色
            }
            Labellastpos.Text = pos.ToString();
            Label ln = (Label)DLgroups.Items[pos].FindControl("LabelSname");
            LabelLeader.Text = ln.Text;
            string sid  = ((Label)DLgroups.Items[pos].FindControl("LabelSid")).Text;
            string snum = ((Label)DLgroups.Items[pos].FindControl("LabelSnum")).Text;
            LearnSite.BLL.Students sbll = new LearnSite.BLL.Students();
            Labelmember.Text = sbll.GroupMember(sgrade, sclass, int.Parse(sid));
            LearnSite.BLL.GroupWork   gbll   = new LearnSite.BLL.GroupWork();
            LearnSite.Model.GroupWork gmodel = new LearnSite.Model.GroupWork();
            gmodel = gbll.GetModelBySnum(snum, mid);
            if (gmodel != null)
            {
                DDLGscores.SelectedValue = gmodel.Gscore.ToString();
                DDLGscores.Enabled       = true;
                Labelgid.Text            = gmodel.Gid.ToString();
                string url     = gmodel.Gurl;
                string ext     = LearnSite.Common.WordProcess.getext(url);
                string htmname = "index.htm";
                if (string.IsNullOrEmpty(ext))
                {
                    ext = "htm";
                }
                LiteralView.Text = LearnSite.Common.WordProcess.SelectWriteTeaNew(ext, url, true, htmname);
            }
            else
            {
                DDLGscores.SelectedValue = "0";
                DDLGscores.Enabled       = false;
                LiteralView.Text         = "";
            }
        }
    }