private void showSummary()
    {
        if (Request.QueryString["Scid"] != null)
        {
            int Sgrade = cook.Sgrade;
            int Sclass = cook.Sclass;
            int Scid   = Int32.Parse(Request.QueryString["Scid"].ToString());
            LearnSite.Model.Summary smodel = new LearnSite.Model.Summary();
            LearnSite.BLL.Summary   sbll   = new LearnSite.BLL.Summary();
            int hid = cook.Rhid;
            smodel = sbll.GetModelByClass(Scid, hid, Sgrade, Sclass);
            LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses();
            Label1.Text = cbll.GetTitle(Scid);
            if (smodel != null)
            {
                contentstr         = HttpUtility.HtmlDecode(smodel.Scontent);
                Label6.Text        = smodel.Sdate.ToString();
                ButtonEdit.Text    = "保存修改";
                ButtonEdit.ToolTip = smodel.Sid.ToString();//临时保存要修改的总结ID
            }
            else
            {
                ButtonEdit.Text    = "添加总结";
                ButtonEdit.ToolTip = "";
            }
            int    Syear = cook.Syear;
            string Snum  = cook.Snum;

            string teasnum = "s" + hid + Syear.ToString() + Sgrade.ToString() + Sclass.ToString();
            if (teasnum == Snum)
            {
                ButtonEdit.Enabled = true;
            }
        }
    }
Exemple #2
0
    private void showSummary()
    {
        if (Request.QueryString["Scid"] != null)
        {
            LearnSite.Model.Cook cook = new LearnSite.Model.Cook();

            int Sgrade = cook.Sgrade;
            int Sclass = cook.Sclass;
            int Scid   = Int32.Parse(Request.QueryString["Scid"].ToString());
            LearnSite.Model.Summary smodel = new LearnSite.Model.Summary();
            LearnSite.BLL.Summary   sbll   = new LearnSite.BLL.Summary();
            int hid = cook.Rhid;

            if (hid != 0)
            {
                LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses();
                Label1.Text = cbll.GetTitle(Scid);
                smodel      = sbll.GetModelByClass(Scid, hid, Sgrade, Sclass);
                if (smodel != null)
                {
                    // LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission();
                    if (smodel.Sshow.Value)
                    {
                        contents.InnerHtml = HttpUtility.HtmlDecode(smodel.Scontent);
                    }
                    else
                    {
                        contents.InnerHtml = "隐藏内容!";
                    }
                    Label6.Text = smodel.Sdate.ToString();
                }
                else
                {
                    contents.InnerHtml = "老师还未填写总结!";
                }
            }
            int    Syear = cook.Syear;
            string Snum  = cook.Snum;

            string teasnum = "s" + hid + Syear.ToString() + Sgrade.ToString() + Sclass.ToString();
            if (teasnum == Snum)
            {
                BtnEdit.Enabled = true;
                BtnEdit.ToolTip = "修改或添加总结!";
            }
        }
    }
Exemple #3
0
    private void showSummary()
    {
        if (Request.QueryString["Scid"] != 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 Scid   = Int32.Parse(Request.QueryString["Scid"].ToString());
            LearnSite.Model.Summary smodel = new LearnSite.Model.Summary();
            LearnSite.BLL.Summary   sbll   = new LearnSite.BLL.Summary();
            string hid = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Rhid"].ToString();

            if (!string.IsNullOrEmpty(hid))
            {
                LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses();
                Label1.Text = cbll.GetTitle(Scid);
                smodel      = sbll.GetModelByClass(Scid, Int32.Parse(hid), Sgrade, Sclass);
                if (smodel != null)
                {
                    // LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission();
                    if (smodel.Sshow.Value)
                    {
                        contents.InnerHtml = HttpUtility.HtmlDecode(smodel.Scontent);
                    }
                    else
                    {
                        contents.InnerHtml = "隐藏内容!";
                    }
                    Label6.Text = smodel.Sdate.ToString();
                }
                else
                {
                    contents.InnerHtml = "老师还未填写总结!";
                }
            }
            string Syear = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Syear"].ToString();
            string Snum  = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Snum"].ToString();

            string teasnum = "s" + hid + Syear + Sgrade.ToString() + Sclass.ToString();
            if (teasnum == Snum)
            {
                BtnEdit.Enabled = true;
                BtnEdit.ToolTip = "修改或添加总结!";
            }
        }
    }
    protected void ButtonEdit_Click(object sender, EventArgs e)
    {
        string fckstr = Request.Form["textareaItem"].Trim();

        if (fckstr.Length > 5)
        {
            LearnSite.Model.Summary smodel = new LearnSite.Model.Summary();
            LearnSite.BLL.Summary   sbll   = new LearnSite.BLL.Summary();
            string sCid = Request.QueryString["Scid"].ToString();
            smodel.Scid     = Int32.Parse(sCid);
            smodel.Sclass   = cook.Sclass;
            smodel.Scontent = HttpUtility.HtmlEncode(fckstr);
            smodel.Sdate    = DateTime.Now;
            smodel.Sgrade   = cook.Sgrade;
            smodel.Shid     = cook.Rhid;
            smodel.Sshow    = true;
            smodel.Syear    = DateTime.Now.Year;
            string msg = "修改课堂活动总结成功!";
            if (ButtonEdit.ToolTip != "")
            {
                smodel.Sid = Int32.Parse(ButtonEdit.ToolTip);
                sbll.Update(smodel);
            }
            else
            {
                sbll.Add(smodel);
                msg = "添加课堂活动总结成功!";
            }
            LearnSite.Common.WordProcess.Alert(msg, this.Page);
            string surl = "~/Student/summary.aspx?Cid=" + sCid + "&Scid=" + sCid;
            Response.Redirect(surl);
        }
        else
        {
            string msg = "不能输入少于6个汉字!";
            LearnSite.Common.WordProcess.Alert(msg, this.Page);
        }
    }