private void showtopic()
    {
        if (Request.QueryString["Tid"] != null)
        {
            int tid = Int32.Parse(Request.QueryString["Tid"].ToString());
            LearnSite.BLL.TopicDiscuss   tbll   = new LearnSite.BLL.TopicDiscuss();
            LearnSite.Model.TopicDiscuss tmodel = new LearnSite.Model.TopicDiscuss();
            tmodel              = tbll.GetModel(tid);//获取主题讨论实体
            Labeltopic.Text     = tmodel.Ttitle;
            TcloseCheck.Checked = tmodel.Tclose;

            Topics.InnerHtml = "<br/>&nbsp;讨论内容:" + HttpUtility.HtmlDecode(tmodel.Tcontent);
            LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses();
            Labelcourse.Text = cbll.GetTitle(tmodel.Tcid.Value);//获取学案名称

            LearnSite.BLL.TopicReply rbll = new LearnSite.BLL.TopicReply();

            TopicsResult.InnerHtml = "<br/>&nbsp;老师总结:";

            if (tmodel.Tclose)
            {
                Btnword.Enabled   = false;//不可发表讨论
                Btnclock.ImageUrl = "~/Images/clockred.gif" + "?temp=" + DateTime.Now.Millisecond.ToString();
                Btnclock.ToolTip  = "当前主题讨论关闭!";
            }
            else
            {
                Btnword.Enabled   = true;//可发表讨论
                Btnclock.ImageUrl = "~/Images/clock.gif" + "?temp=" + DateTime.Now.Millisecond.ToString();
                Btnclock.ToolTip  = "当前主题讨论开启!";
            }
        }
    }
Beispiel #2
0
 private void ShowTopic()
 {
     if (Request.QueryString["Tid"] != null)
     {
         int Tid = Int32.Parse(Request.QueryString["Tid"].ToString());
         LearnSite.BLL.TopicDiscuss   bll   = new LearnSite.BLL.TopicDiscuss();
         LearnSite.Model.TopicDiscuss model = new LearnSite.Model.TopicDiscuss();
         model            = bll.GetModel(Tid);
         Labeltid.Text    = model.Tid.ToString();
         LabelTtitle.Text = model.Ttitle;
         LabelMcid.Text   = model.Tcid.ToString();
         LabelTdate.Text  = model.Tdate.ToString();
         bool isClose = model.Tclose;
         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  = "讨论开启!";
         }
         Tcontent.InnerHtml = HttpUtility.HtmlDecode(model.Tcontent);
     }
 }
Beispiel #3
0
 protected void Btnclock_Click(object sender, ImageClickEventArgs e)
 {
     if (Request.QueryString["Tid"] != null)
     {
         int tid = Int32.Parse(Request.QueryString["Tid"].ToString());
         LearnSite.BLL.TopicDiscuss tdbll = new LearnSite.BLL.TopicDiscuss();
         tdbll.UpdateTclose(tid);//更新
         System.Threading.Thread.Sleep(500);
         ShowTopic();
     }
 }
Beispiel #4
0
 private void showtopic()
 {
     if (Request.QueryString["Tid"] != null)
     {
         int tid = Int32.Parse(Request.QueryString["Tid"]);
         LearnSite.BLL.TopicDiscuss   bll   = new LearnSite.BLL.TopicDiscuss();
         LearnSite.Model.TopicDiscuss model = new LearnSite.Model.TopicDiscuss();
         model              = bll.GetModel(tid);
         Texttitle.Text     = model.Ttitle;
         mcontent.InnerText = HttpUtility.HtmlDecode(model.Tcontent);
         CheckClose.Checked = model.Tclose;
     }
 }
Beispiel #5
0
    protected void Btnadd_Click(object sender, EventArgs e)
    {
        string fckstr = Request.Form["textareaItem"].Trim();

        if (Texttitle.Text != "" && fckstr != "")
        {
            if (Request.QueryString["Mcid"] != null)
            {
                LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
                string hidstr = tcook.Hid.ToString();
                //string serverUrl = LearnSite.Common.WordProcess.ServerUrl();
                //fckstr = fckstr.Replace(serverUrl, "");
                int Mcid = Int32.Parse(Request.QueryString["Mcid"].ToString());
                LearnSite.BLL.TopicDiscuss   bll   = new LearnSite.BLL.TopicDiscuss();
                LearnSite.Model.TopicDiscuss model = new LearnSite.Model.TopicDiscuss();
                model.Tcid     = Mcid;
                model.Ttitle   = Texttitle.Text.Trim();
                model.Tcontent = HttpUtility.HtmlEncode(fckstr);
                model.Tcount   = 0;
                model.Tteacher = Int32.Parse(hidstr);
                model.Tdate    = DateTime.Now;
                model.Tclose   = CheckPublish.Checked;
                model.Tresult  = "";
                int tid = bll.Add(model);

                LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu();
                LearnSite.BLL.ListMenu   lbll   = new LearnSite.BLL.ListMenu();
                lmodel.Lcid   = Mcid;
                lmodel.Lshow  = true;
                lmodel.Lsort  = lbll.GetMaxLsort(Mcid) + 1;
                lmodel.Ltitle = Texttitle.Text.Trim();
                lmodel.Ltype  = 3;
                lmodel.Lxid   = tid;
                lbll.Add(lmodel);

                System.Threading.Thread.Sleep(500);
                //Labelmsg.Text = "添加主题讨论成功";
                string url = "~/Teacher/courseshow.aspx?Cid=" + Mcid.ToString();
                Response.Redirect(url, false);
            }
        }
        else
        {
            Labelmsg.Text = "内容及标题不能为空!";
        }
    }
    private void showtopic()
    {
        if (Request.QueryString["Tid"] != null)
        {
            int tid = Int32.Parse(Request.QueryString["Tid"].ToString());
            LearnSite.BLL.TopicDiscuss   tbll   = new LearnSite.BLL.TopicDiscuss();
            LearnSite.Model.TopicDiscuss tmodel = new LearnSite.Model.TopicDiscuss();
            tmodel              = tbll.GetModel(tid);//获取主题讨论实体
            Labeltopic.Text     = tmodel.Ttitle;
            TcloseCheck.Checked = tmodel.Tclose;

            Topics.InnerHtml = "讨论内容:" + HttpUtility.HtmlDecode(tmodel.Tcontent);
            LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses();
            string mynum = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Snum"].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 syear  = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Syear"].ToString());
            int hid    = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Rhid"].ToString());

            string teasnum = "s" + hid + syear.ToString() + sgrade.ToString() + sclass.ToString();
            LearnSite.BLL.TopicReply rbll = new LearnSite.BLL.TopicReply();
            string treply = rbll.getteareply(tid, teasnum);
            TopicsResult.InnerHtml = "老师总结:" + HttpUtility.HtmlDecode(treply);

            if (mynum == teasnum)
            {
                Btnclock.Enabled        = true;
                Btnword.Text            = "老师总结";
                ImageBtngoodall.Visible = true;
            }
            if (tmodel.Tclose)
            {
                Btnword.Enabled   = false;//不可发表讨论
                Btnclock.ImageUrl = "~/Images/clockred.gif" + "?temp=" + DateTime.Now.Millisecond.ToString();
                Btnclock.ToolTip  = "主题讨论暂停!";
            }
            else
            {
                Btnword.Enabled   = true;//可发表讨论
                Btnclock.ImageUrl = "~/Images/clock.gif" + "?temp=" + DateTime.Now.Millisecond.ToString();
                Btnclock.ToolTip  = "主题讨论开启!";
            }
        }
    }
    protected void Btnclock_Click(object sender, ImageClickEventArgs e)
    {
        if (Btnword.Text == "老师总结")
        {
            bool chbtn = false;

            if (TcloseCheck.Checked)
            {
                chbtn = false;//取反
            }
            else
            {
                chbtn = true;
            }

            int tid = Int32.Parse(Request.QueryString["Tid"].ToString());
            LearnSite.BLL.TopicDiscuss tdbll = new LearnSite.BLL.TopicDiscuss();
            tdbll.UpdateTclose(tid, chbtn);//更新
            System.Threading.Thread.Sleep(500);
            showtopic();
        }
    }
Beispiel #8
0
    protected void Btnedit_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["Tcid"] != null)
        {
            string fckstr = mcontent.InnerText;
            if (Texttitle.Text != "" && fckstr != "")
            {
                LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
                string hidstr = tcook.Hid.ToString();
                int    Tcid   = Int32.Parse(Request.QueryString["Tcid"].ToString());
                int    Tid    = Int32.Parse(Request.QueryString["Tid"].ToString());
                LearnSite.BLL.TopicDiscuss bll = new LearnSite.BLL.TopicDiscuss();

                string Ttitle   = Texttitle.Text.Trim();
                string Tcontent = HttpUtility.HtmlEncode(fckstr);
                bool   Tclose   = CheckClose.Checked;
                bll.UpdateTopic(Tid, Ttitle, Tcontent, Tclose);

                LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu();
                LearnSite.BLL.ListMenu   lbll   = new LearnSite.BLL.ListMenu();

                lmodel.Lcid   = Tcid;
                lmodel.Lxid   = Tid;
                lmodel.Ltype  = 3;
                lmodel.Ltitle = Texttitle.Text.Trim();
                lbll.UpdateLtitle(lmodel);

                System.Threading.Thread.Sleep(200);
                string url = "~/Teacher/topicshow.aspx?Tid=" + Tid;
                Response.Redirect(url, false);
            }
            else
            {
                Labelmsg.Text = "内容及标题不能为空!";
            }
        }
    }
Beispiel #9
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();
    }