コード例 #1
0
 private void totalclass()
 {
     if (DDLgrade.SelectedValue != null && DDLclass.SelectedValue != null)
     {
         int sgrade = Int32.Parse(DDLgrade.SelectedValue);
         int sclass = Int32.Parse(DDLclass.SelectedValue);
         LearnSite.BLL.Students sbll = new LearnSite.BLL.Students();
         TextBoxcount.Text = sbll.CountClassMate(sgrade, sclass).ToString();//获取该班级人数
     }
 }
コード例 #2
0
ファイル: mysurvey.aspx.cs プロジェクト: pyteach/Learnsite
    private void showSurvey()
    {
        if (Request.QueryString["Vid"] != null && Request.QueryString["Cid"] != null)
        {
            int    vid  = Int32.Parse(Request.QueryString["Vid"].ToString());
            int    cid  = Int32.Parse(Request.QueryString["Cid"].ToString());
            string fnum = cook.Snum;

            LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey();
            LearnSite.BLL.Survey   vbll   = new LearnSite.BLL.Survey();
            vmodel             = vbll.GetModel(vid);
            Lbtitle.Text       = vmodel.Vtitle;
            vcontent.InnerHtml = HttpUtility.HtmlDecode(vmodel.Vcontent);
            int vtype = vmodel.Vtype.Value;
            Lbtype.Text = vtype.ToString();
            if (vtype > 0)
            {
                Lbtypecn.Text = "测验";
            }
            else
            {
                Lbtypecn.Text = "调查";
            }
            Lbsname.Text = Server.UrlDecode(cook.Sname);
            Lbsnum.Text  = fnum;
            bool isClose = vmodel.Vclose;
            if (isClose)
            {
                Btnclock.ImageUrl = "~/Images/clockred.gif" + "?temp=" + DateTime.Now.Millisecond.ToString();
                Btnclock.ToolTip  = "暂停,请咨询老师!";
            }
            else
            {
                Btnclock.ImageUrl = "~/Images/clock.gif" + "?temp=" + DateTime.Now.Millisecond.ToString();
                Btnclock.ToolTip  = "开启,请开始回答!";
                showQuestion();
            }
            int myscore = GetMyScore(vid, fnum);
            if (myscore != -1024)
            {
                //如果已经回答过调查
                Btnok.Visible     = false;
                Lbcheck.Text      = "已完成!";
                Lbcheck.BackColor = System.Drawing.Color.Green;
                Lbfscore.Text     = myscore.ToString();
                int syear  = cook.Syear;
                int sgrade = cook.Sgrade;
                int sclass = cook.Sclass;

                LearnSite.BLL.Students sbll = new LearnSite.BLL.Students();
                int cns = sbll.CountClassMate(sgrade, sclass);
                LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback();
                int dcn = fbll.GetSurveyStu(sgrade, sclass, cid, vid);
                if (dcn == cns)
                {
                    Btnshow.Visible = true;
                }
            }
            else
            {
                Lbfscore.Text = "0";
                if (isClose)
                {
                    Btnok.Visible = false;//如果关闭调查,则提交按钮无效
                }
                else
                {
                    Btnok.Visible = true;
                    if (Session[fnum + "survey" + vid] != null)
                    {
                        DateTime oldtime = DateTime.Parse(Session[fnum + "survey" + vid].ToString());
                        DateTime nowtime = DateTime.Now;
                        Lbtime.Text = LearnSite.Common.Computer.DatagoneMinute(oldtime, nowtime);
                    }
                    else
                    {
                        Session[fnum + "survey" + vid] = DateTime.Now.ToString();
                    }
                }
                Lbcheck.Text      = "未完成!";
                Lbcheck.BackColor = System.Drawing.Color.Red;
                Btnshow.Visible   = false;
            }
            if (fnum.IndexOf('s') > -1)
            {
                Btnshow.Visible  = true;
                Btnok.Visible    = false;
                Btnclock.Enabled = true;
            }
            else
            {
                Btnclock.Enabled = false;
            }
        }
    }