コード例 #1
0
    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  = "当前主题讨论开启!";
            }
        }
    }
コード例 #2
0
ファイル: topicshow.aspx.cs プロジェクト: pyteach/Learnsite
 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);
     }
 }
コード例 #3
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;
     }
 }
コード例 #4
0
ファイル: TopicDiscuss.cs プロジェクト: pyteach/Learnsite
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LearnSite.Model.TopicDiscuss> DataTableToList(DataTable dt)
        {
            List <LearnSite.Model.TopicDiscuss> modelList = new List <LearnSite.Model.TopicDiscuss>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LearnSite.Model.TopicDiscuss model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LearnSite.Model.TopicDiscuss();
                    if (dt.Rows[n]["Tid"].ToString() != "")
                    {
                        model.Tid = int.Parse(dt.Rows[n]["Tid"].ToString());
                    }
                    if (dt.Rows[n]["Tcid"].ToString() != "")
                    {
                        model.Tcid = int.Parse(dt.Rows[n]["Tcid"].ToString());
                    }
                    model.Ttitle   = dt.Rows[n]["Ttitle"].ToString();
                    model.Tcontent = dt.Rows[n]["Tcontent"].ToString();
                    if (dt.Rows[n]["Tcount"].ToString() != "")
                    {
                        model.Tcount = int.Parse(dt.Rows[n]["Tcount"].ToString());
                    }
                    if (dt.Rows[n]["Tteacher"].ToString() != "")
                    {
                        model.Tteacher = int.Parse(dt.Rows[n]["Tteacher"].ToString());
                    }
                    if (dt.Rows[n]["Tdate"].ToString() != "")
                    {
                        model.Tdate = DateTime.Parse(dt.Rows[n]["Tdate"].ToString());
                    }
                    if (dt.Rows[n]["Tclose"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Tclose"].ToString() == "1") || (dt.Rows[n]["Tclose"].ToString().ToLower() == "true"))
                        {
                            model.Tclose = true;
                        }
                        else
                        {
                            model.Tclose = false;
                        }
                    }
                    model.Tresult = dt.Rows[n]["Tresult"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #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 = "内容及标题不能为空!";
        }
    }
コード例 #6
0
    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  = "主题讨论开启!";
            }
        }
    }
コード例 #7
0
ファイル: TopicDiscuss.cs プロジェクト: pyteach/Learnsite
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LearnSite.Model.TopicDiscuss model)
 {
     return(dal.Update(model));
 }
コード例 #8
0
ファイル: TopicDiscuss.cs プロジェクト: pyteach/Learnsite
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LearnSite.Model.TopicDiscuss model)
 {
     return(dal.Add(model));
 }