Example #1
0
 private void showsurvey()
 {
     if (Request.QueryString["Vid"] != null)
     {
         string vid = Request.QueryString["Vid"].ToString();
         LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey();
         LearnSite.BLL.Survey   vbll   = new LearnSite.BLL.Survey();
         vmodel     = vbll.GetModel(Int32.Parse(vid));
         Lbave.Text = vmodel.Vaverage.ToString();
         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  = "调查开启!";
         }
         Lbdate.Text  = vmodel.Vdate.ToString();
         Lbscore.Text = vmodel.Vscore.ToString();
         Lbtitle.Text = vmodel.Vtitle;
         if (vmodel.Vtype.Value == 0)
         {
             Lbtype.Text = "调查";
         }
         else
         {
             Lbtype.Text = "测验";
         }
         vcontent.InnerHtml = HttpUtility.HtmlDecode(vmodel.Vcontent);
     }
 }
Example #2
0
    private void showSurvey()
    {
        if (Request.QueryString["Vid"] != null && Request.QueryString["Cid"] != null)
        {
            string vid = Request.QueryString["Vid"].ToString();

            LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey();
            LearnSite.BLL.Survey   vbll   = new LearnSite.BLL.Survey();
            vmodel             = vbll.GetModel(Int32.Parse(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 = "调查";
            }
            showQuestion();
            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  = "调查开启,请开始回答!";
            }
        }
    }
Example #3
0
 private void showCalculate()
 {
     if (Request.QueryString["Vid"] != null)
     {
         int vid = Int32.Parse(Request.QueryString["Vid"].ToString());
         LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey();
         vbll.Updatevtotal(vid); // 统计调查卷下的试题数
         vbll.Updatevscore(vid); // 统计调查卷下的试题总分
     }
 }
Example #4
0
 protected void Btnclock_Click(object sender, ImageClickEventArgs e)
 {
     if (Request.QueryString["Vid"] != null)
     {
         int vid = Int32.Parse(Request.QueryString["Vid"].ToString());
         LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey();
         vbll.UpdateVclose(vid);
         System.Threading.Thread.Sleep(500);
         showsurvey();
     }
 }
Example #5
0
    protected void Btnclock_Click(object sender, ImageClickEventArgs e)
    {
        string fnum = Server.UrlDecode(cook.Snum);

        if (fnum.IndexOf('s') > -1)
        {
            int vid = Int32.Parse(Request.QueryString["Vid"].ToString());
            LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey();
            vbll.UpdateVclose(vid);
            showSurvey();
        }
    }
Example #6
0
 private void showsurvey()
 {
     if (Request.QueryString["Vid"] != null)
     {
         Btnadd.Text = "修改调查";
         string vid = Request.QueryString["Vid"].ToString();
         LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey();
         LearnSite.BLL.Survey   vbll   = new LearnSite.BLL.Survey();
         vmodel                 = vbll.GetModel(Int32.Parse(vid));
         Texttitle.Text         = vmodel.Vtitle;
         DDLvtype.SelectedValue = vmodel.Vtype.ToString();
         CheckClose.Checked     = vmodel.Vclose;
         mcontent.InnerText     = HttpUtility.HtmlDecode(vmodel.Vcontent);
     }
 }
 private void showSurvey()
 {
     if (Request.QueryString["Vid"] != null && Request.QueryString["Cid"] != null)
     {
         int vid    = Int32.Parse(Request.QueryString["Vid"].ToString());
         int syear  = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Syear"].ToString());
         int sgrade = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString());
         int sclass = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString());
         int sterm  = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["ThisTerm"].ToString());
         int cid    = Int32.Parse(Request.QueryString["Cid"].ToString());
         LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey();
         LearnSite.BLL.Survey   vbll   = new LearnSite.BLL.Survey();
         vmodel = vbll.GetModel(vid);
         int vtype = vmodel.Vtype.Value;
         Lbtitle.Text       = "《" + vmodel.Vtitle + "》班级统计分析";
         vcontent.InnerHtml = HttpUtility.HtmlDecode(vmodel.Vcontent);
         Lbdate.Text        = vmodel.Vdate.ToString();
         Lbsgrade.Text      = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString();
         string fnum = Server.UrlDecode(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Snum"].ToString());
         Lbsclass.Text = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString();
         bool isClose = vmodel.Vclose;
         if (!isClose)
         {
             surveyClass();//更新统计
         }
         else
         {
             itemandcount = surveyClassView(syear, sgrade, sclass, sterm, cid, vid);//历史统计显示
         }
         if (fnum.IndexOf('s') > -1)
         {
             Btnrefresh.Visible = true;//限制为模拟学生可以进行统计(方便老师,减少数据库查询)
         }
         else
         {
             Btnrefresh.Visible = false;
         }
         showQuestion();//显示问题
         LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback();
         Lbstus.Text             = fbll.GetSurveyStu(sgrade, sclass, cid, vid).ToString() + "人";
         stuList.InnerHtml       = "未参与同学列表:<br />" + fbll.GetNoSurveyStu(sgrade, sclass, cid, vid);
         HLclassrank.NavigateUrl = "mysurveyrank.aspx?Vid=" + vid;
         HLclassrank.Visible     = true;
     }
 }
Example #8
0
 protected void Btnset_Click(object sender, EventArgs e)
 {
     if (Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname] != null)
     {
         string             Hid    = tcook.Hid.ToString();
         int                Rhid   = Int32.Parse(Hid);//教师编号
         int                Rgrade = Int32.Parse(DDLgrade.SelectedValue);
         int                Rclass = Int32.Parse(DDLclass.SelectedValue);
         LearnSite.BLL.Room rm     = new LearnSite.BLL.Room();
         string             cid    = DDLCid.SelectedValue;
         if (!string.IsNullOrEmpty(cid))
         {
             rm.UpdateRcid(Rgrade, Rclass, Int32.Parse(cid));
         }
         if (LearnSite.Common.XmlHelp.LoginMode() == 1) //如果是0,个人模式,1为班级模式
         {
             int pwdlen = 3;
             TBpwd.Text    = rm.TeachingRoomSet(Rhid, Rgrade, Rclass, pwdlen);//返回班级密码
             TBpwd.ToolTip = "班级模式下学生登录的密码!";
         }
         else
         {
             TBpwd.Text = "个人模式";
             int pwdlen = 6;
             rm.TeachingRoomSet(Rhid, Rgrade, Rclass, pwdlen);//设置一下配合黄池祥老师的管理软件
             TBpwd.ToolTip = "学生登录请使用自己的个人密码!";
         }
         Session[Hid + "grade"]     = DDLgrade.SelectedValue;
         Session[Hid + "StartTime"] = DateTime.Now.ToString();
         Btnset.Enabled             = false;
         DDLgrade.Enabled           = false;
         DDLclass.Enabled           = false;
         DDLhouse.Enabled           = false;
         Btnstudent.Enabled         = true;
         Btnrefresh.Enabled         = true;
         LearnSite.BLL.Students stu = new LearnSite.BLL.Students();
         stu.ThisClassTeamScoresNew(Rgrade, Rclass);//批量更新group新方法
         ShowNoSigin();
         DDLCid.Enabled = false;
         LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey();
         vbll.SetClose(Rhid);//开始上课时,先将测验处于关闭状态
     }
 }
Example #9
0
 private void showFscore()
 {
     if (Request.QueryString["Vid"] != null)
     {
         int sgrade = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString());
         int sclass = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString());
         int vid    = Int32.Parse(Request.QueryString["Vid"].ToString());
         LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback();
         GridViewclass.DataSource = fbll.GetClassFscore(sgrade, sclass, vid);
         GridViewclass.DataBind();
         LearnSite.BLL.Survey   vbll  = new LearnSite.BLL.Survey();
         LearnSite.Model.Survey model = new LearnSite.Model.Survey();
         model           = vbll.GetModel(vid);
         Labeltitle.Text = HttpUtility.HtmlDecode(model.Vtitle);
         if (GridViewclass.Rows.Count < 1)
         {
             Labelmsg.Text = "暂无排行!";
         }
     }
 }
Example #10
0
    protected void Btnadd_Click(object sender, EventArgs e)
    {
        string fckstr = mcontent.InnerText;

        if (Texttitle.Text != "" && fckstr != "")
        {
            if (Request.QueryString["Cid"] != null)
            {
                LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
                string hidstr = tcook.Hid.ToString();
                int    Vcid   = Int32.Parse(Request.QueryString["Cid"].ToString());
                LearnSite.BLL.Survey   vbll   = new LearnSite.BLL.Survey();
                LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey();
                vmodel.Vcid     = Vcid;
                vmodel.Vclose   = CheckClose.Checked;
                vmodel.Vcontent = HttpUtility.HtmlEncode(fckstr);
                vmodel.Vdate    = DateTime.Now;
                vmodel.Vhid     = Int32.Parse(hidstr);
                bool vp = false;
                vmodel.Vpoint = vp;
                vmodel.Vtitle = Texttitle.Text.Trim();
                int Vtype = Int32.Parse(DDLvtype.SelectedValue);
                vmodel.Vtype = Vtype;
                //Vcid,Vhid,Vtitle,Vcontent,Vtype,Vclose,Vpoint,Vdate
                string url = "";

                LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu();
                LearnSite.BLL.ListMenu   lbll   = new LearnSite.BLL.ListMenu();
                lmodel.Lcid   = Vcid;
                lmodel.Lshow  = true;
                lmodel.Lsort  = lbll.GetMaxLsort(Vcid) + 1;
                lmodel.Ltitle = Texttitle.Text.Trim();
                lmodel.Ltype  = 2;

                if (Request.QueryString["Vid"] != null)
                {
                    int vid = Int32.Parse(Request.QueryString["Vid"].ToString());
                    vmodel.Vid = vid;
                    vbll.UpdateSurvey(vmodel);      //更新到调查表中
                    lmodel.Lxid = vid;
                    lbll.UpdateLtitle(lmodel);      //更新到导航中
                    LearnSite.BLL.SurveyFeedback fkbll = new LearnSite.BLL.SurveyFeedback();
                    fkbll.UpdateFvtype(vid, Vtype); //2014-3-15修订,如果调查类型改变的话,同时也改变调查结果记录中的类型
                    url = "~/Survey/survey.aspx?Cid=" + Vcid + "&Vid=" + vid;

                    System.Threading.Thread.Sleep(500);
                }
                else
                {
                    int newvid = vbll.Addsurvey(vmodel); //增加到调查表中
                    lmodel.Lxid = newvid;
                    lbll.Add(lmodel);                    //增加到导航中
                    System.Threading.Thread.Sleep(500);
                    url = "~/Survey/survey.aspx?Cid=" + Vcid + "&Vid=" + newvid;
                }
                Response.Redirect(url, false);
            }
        }
        else
        {
            Labelmsg.Text = "内容及标题不能为空!";
        }
    }
Example #11
0
    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;
            }
        }
    }
Example #12
0
    protected void GVlistmenu_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int    RowIndex = Convert.ToInt32(e.CommandArgument);
        int    Lid      = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex].FindControl("LabelLid")).Text);
        int    lxid     = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex].FindControl("LabelLxid")).Text);
        string ltype    = ((Label)GVlistmenu.Rows[RowIndex].FindControl("LabelLtype")).Text;
        //int lsort = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex].FindControl("LabelLsort")).Text);
        int Lcid = Int32.Parse(Request.QueryString["Cid"].ToString());

        LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu();
        if (e.CommandName == "P")
        {
            switch (ltype)
            {
            case "1":    //活动
            case "5":    //编程
            case "6":    //描述
                LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission();
                mbll.UpdateMpublish(lxid);
                lbll.UpdateLshow(Lid);
                break;

            case "2":    //调查
                LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey();
                vbll.UpdateVclose(lxid);
                lbll.UpdateLshow(Lid);
                break;

            case "3":    //讨论
                LearnSite.BLL.TopicDiscuss tbll = new LearnSite.BLL.TopicDiscuss();
                tbll.UpdateTclose(lxid);
                lbll.UpdateLshow(Lid);
                break;

            case "4":    //表单
                LearnSite.BLL.TxtForm tbmbll = new LearnSite.BLL.TxtForm();
                tbmbll.UpdateMpublish(lxid);
                lbll.UpdateLshow(Lid);
                break;
            }
        }
        if (e.CommandName == "D")
        {
            switch (ltype)
            {
            case "1":                     //活动
            case "5":                     //编程
            case "6":                     //描述
                LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission();
                mbll.DeleteMission(lxid); //假删除任务
                lbll.Delete(Lid);         //删除导航
                break;

            case "2":    //调查
                LearnSite.BLL.Survey         vbll = new LearnSite.BLL.Survey();
                LearnSite.BLL.SurveyQuestion qbll = new LearnSite.BLL.SurveyQuestion();
                if (!qbll.ExistsByQvid(lxid))
                {
                    vbll.Delete(lxid);   //删除调查
                    lbll.Delete(Lid);    //删除导航
                }
                else
                {
                    string msg = "该调查卷存在试题,请先删除试题!";
                    LearnSite.Common.WordProcess.Alert(msg, this.Page);
                }
                break;

            case "3":              //讨论
                LearnSite.BLL.TopicDiscuss tbll = new LearnSite.BLL.TopicDiscuss();
                tbll.Delete(lxid); //删除讨论
                lbll.Delete(Lid);  //删除导航
                break;

            case "4":                //表单
                LearnSite.BLL.TxtForm tfmbll = new LearnSite.BLL.TxtForm();
                tfmbll.Delete(lxid); //删除表单
                lbll.Delete(Lid);    //删除导航
                break;
            }
        }

        if (e.CommandName == "Top")
        {
            if (RowIndex == 0)
            {
                lbll.Lsortnew(Lcid);//如果首行,初始化序号
            }
            if (RowIndex > 0)
            {
                int toplid = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex - 1].FindControl("LabelLid")).Text); //获取上个导航编号
                lbll.UpdateLsort(Lid, false);                                                                      //当前导航减1向上
                lbll.UpdateLsort(toplid, true);                                                                    //上个导航增1向下
            }
            System.Threading.Thread.Sleep(500);
            lbll.UpdateMissonListMene(Lcid, lxid);//活动序号同步
        }
        if (e.CommandName == "Bottom")
        {
            int rowscount = GVlistmenu.Rows.Count;
            if (RowIndex < rowscount - 1)
            {
                int bottomlid = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex + 1].FindControl("LabelLid")).Text); //获取下个导航编号
                lbll.UpdateLsort(bottomlid, false);                                                                   //下个导航减1向上
                lbll.UpdateLsort(Lid, true);                                                                          //当前导航增1向下
                System.Threading.Thread.Sleep(500);
                lbll.UpdateMissonListMene(Lcid, lxid);                                                                //活动序号同步
            }
        }

        System.Threading.Thread.Sleep(200);
        showmenu();
    }