示例#1
0
    private void ShowTxtForm()
    {
        string Mid = Request.QueryString["Mid"].ToString();

        LearnSite.Model.Cook cook = new LearnSite.Model.Cook();
        int Wsid = cook.Sid;

        if (LearnSite.Common.WordProcess.IsNum(Mid))
        {
            LearnSite.Model.TxtForm tmodel = new LearnSite.Model.TxtForm();
            LearnSite.BLL.TxtForm   tbll   = new LearnSite.BLL.TxtForm();

            tmodel = tbll.GetModel(Int32.Parse(Mid));
            if (tmodel != null)
            {
                LabelMtitle.Text = tmodel.Mtitle;

                LearnSite.Model.TxtFormBack rmodel = new LearnSite.Model.TxtFormBack();
                LearnSite.BLL.TxtFormBack   rbll   = new LearnSite.BLL.TxtFormBack();
                int Rid = rbll.GetRid(Wsid.ToString(), Mid);
                if (Rid > 0)
                {
                    rmodel             = rbll.GetModel(Rid);
                    Mcontent.InnerHtml = HttpUtility.HtmlDecode(rmodel.Rwords);
                }
                else
                {
                    Mcontent.InnerHtml = HttpUtility.HtmlDecode(tmodel.Mcontent);
                }
            }
            Hlresult.NavigateUrl = "~/Student/txtformresult.aspx?Mid=" + Mid;
        }
    }
示例#2
0
    private void ShowMtitle()
    {
        string Sgrade = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString();
        string Sclass = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString();

        string mid = Request.QueryString["Mid"].ToString();

        LearnSite.BLL.TxtForm tbll = new LearnSite.BLL.TxtForm();
        string mtitle = tbll.GetMtitle(Int32.Parse(mid));

        LbMtitle.Text = mtitle + "—" + Sgrade + "年级" + Sclass + "班" + "填写列表";
    }
示例#3
0
    private void ShowMtitle()
    {
        int Sgrade = cook.Sgrade;
        int Sclass = cook.Sclass;

        string mid = Request.QueryString["Mid"].ToString();

        LearnSite.BLL.TxtForm tbll = new LearnSite.BLL.TxtForm();
        string mtitle = tbll.GetMtitle(Int32.Parse(mid));

        LbMtitle.Text = mtitle + "—" + Sgrade.ToString() + "年级" + Sclass.ToString() + "班" + "填写列表";
    }
示例#4
0
    protected void Btnedit_Click(object sender, EventArgs e)
    {
        string fckstr = mcontent.InnerText;
        string mtitle = Texttitle.Text.Trim();

        if (mtitle != "" && fckstr != "")
        {
            if (Request.QueryString["Mcid"] != null && Request.QueryString["Mid"] != null)
            {
                Labelmsg.Text = "无";
                string Mcid = Request.QueryString["Mcid"].ToString();
                string Mid  = Request.QueryString["Mid"].ToString();
                LearnSite.Model.TxtForm tmode = new LearnSite.Model.TxtForm();
                tmode.Mid      = Int32.Parse(Mid);
                tmode.Mcid     = Int32.Parse(Mcid);
                tmode.Mtitle   = mtitle;
                tmode.Mpublish = CheckPublish.Checked;
                tmode.Mcontent = HttpUtility.HtmlEncode(fckstr);
                tmode.Mdate    = DateTime.Now;
                tmode.Mhit     = 0;
                tmode.Mdelete  = false;
                LearnSite.BLL.TxtForm tfmbll = new LearnSite.BLL.TxtForm();
                tfmbll.Update(tmode);

                //string msg = tmode.Mtitle + "<br>\r\n" + tmode.Mcontent + "<br>\r\n" + tmode.Mdate.ToString() + "<br>\r\n" + tmode.Mpublish.ToString() + "<br>\r\n" + Mid;
                // Labelmsg.Text = msg;

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

                lmodel.Lcid   = Int32.Parse(Mcid);
                lmodel.Lxid   = Int32.Parse(Mid);
                lmodel.Ltype  = 4;
                lmodel.Lshow  = CheckPublish.Checked;
                lmodel.Ltitle = mtitle;
                lbll.UpdateMenuThree(lmodel);

                System.Threading.Thread.Sleep(500);
                string url = "~/Teacher/txtformshow.aspx?Mcid=" + Mcid + "&Mid=" + Mid;
                Response.Redirect(url, false);
            }
            else
            {
                Labelmsg.Text = "取不到表单编号Mid!";
            }
        }
        else
        {
            Labelmsg.Text = "内容及标题不能为空!";
        }
    }
示例#5
0
    private void txtformview()
    {
        if (Request.QueryString["Mid"] != null)
        {
            int Mid = Int32.Parse(Request.QueryString["Mid"].ToString());
            LearnSite.Model.TxtForm tmodel = new LearnSite.Model.TxtForm();
            LearnSite.BLL.TxtForm   tbll   = new LearnSite.BLL.TxtForm();
            tmodel = tbll.GetModel(Mid);

            mcontent.InnerText   = HttpUtility.HtmlDecode(tmodel.Mcontent);
            CheckPublish.Checked = tmodel.Mpublish;
            Texttitle.Text       = tmodel.Mtitle;
        }
    }
示例#6
0
    private void showtxtform()
    {
        string Mcid = Request.QueryString["Mcid"].ToString();
        string Mid = Request.QueryString["Mid"].ToString();


        LearnSite.Model.TxtForm tmodel = new LearnSite.Model.TxtForm();
        LearnSite.BLL.TxtForm tbll = new LearnSite.BLL.TxtForm();

        tmodel = tbll.GetModel(Int32.Parse(Mid));

        if (tmodel != null)
        {
            LabelMtitle.Text = tmodel.Mtitle;
            CheckPublish.Checked = tmodel.Mpublish;
            Mcontent.InnerHtml = HttpUtility.HtmlDecode(tmodel.Mcontent);
            LabelMdate.Text = tmodel.Mdate.ToString();
        }
    }
示例#7
0
    protected void Btnadd_Click(object sender, EventArgs e)
    {
        string fckstr = Request.Form["textareaItem"].Trim();

        if (Texttitle.Text != "" && fckstr != "")
        {
            if (Request.QueryString["Mcid"] != null)
            {
                string Mcidstr = Request.QueryString["Mcid"].ToString();
                int    Mcid    = Int32.Parse(Mcidstr);
                LearnSite.BLL.TxtForm   tbll  = new LearnSite.BLL.TxtForm();
                LearnSite.Model.TxtForm tmode = new LearnSite.Model.TxtForm();
                LearnSite.BLL.ListMenu  lbll  = new LearnSite.BLL.ListMenu();
                int maxSort = lbll.GetMaxLsort(Mcid) + 1;
                tmode.Mcid     = Mcid;
                tmode.Mtitle   = Texttitle.Text.Trim();
                tmode.Mpublish = CheckPublish.Checked;
                tmode.Mcontent = HttpUtility.HtmlEncode(fckstr);
                tmode.Mdate    = DateTime.Now;
                tmode.Mhit     = 0;
                int mid = tbll.Add(tmode);
                LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu();
                lmodel.Lcid   = Mcid;
                lmodel.Lshow  = CheckPublish.Checked;
                lmodel.Lsort  = maxSort;
                lmodel.Ltitle = Texttitle.Text.Trim();
                lmodel.Ltype  = 4;//表单类型为4
                lmodel.Lxid   = mid;
                lbll.Add(lmodel);
                System.Threading.Thread.Sleep(500);
                string url = "~/Teacher/courseshow.aspx?Cid=" + Mcid.ToString();
                Response.Redirect(url, false);
            }
        }
        else
        {
            Labelmsg.Text = "内容及标题不能为空!";
        }
    }
示例#8
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();
    }