Пример #1
0
    private void GradeClass()
    {
        LearnSite.BLL.Room      rm    = new LearnSite.BLL.Room();
        LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
        string Hid = tcook.Hid.ToString();

        DDLgrade.DataSource     = rm.GetGrade(Int32.Parse(Hid));
        DDLgrade.DataTextField  = "Rgrade";
        DDLgrade.DataValueField = "Rgrade";
        DDLgrade.DataBind();
        if (Request.QueryString["Sgrade"] != null)
        {
            DDLgrade.SelectedValue = Request.QueryString["Sgrade"].ToString();
        }
        DDLgrade.Enabled = false;
        int Rgrade = Int32.Parse(DDLgrade.SelectedValue);

        DDLclass.DataSource     = rm.GetLimitClass(Rgrade);
        DDLclass.DataTextField  = "Rclass";
        DDLclass.DataValueField = "Rclass";
        DDLclass.DataBind();
        if (Request.QueryString["Sclass"] != null)
        {
            DDLclass.SelectedValue = Request.QueryString["Sclass"].ToString();
        }
        DDLclass.Enabled = false;
    }
Пример #2
0
    /// <summary>
    /// 登录cookie设置和跳转
    /// </summary>
    /// <param name="Tmodel"></param>
    /// <param name="aaaastr"></param>
    private void cookieJump(LearnSite.Model.Teacher Tmodel, string aaaastr)
    {
        bool hpermiss = Tmodel.Hpermiss;

        if (LearnSite.Common.CookieHelp.SetTMCookies(Tmodel, hpermiss))
        {
            System.Threading.Thread.Sleep(200);//设置cookies后,延时200毫秒
            if (Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname] != null)
            {
                LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
                Session[tcook.Hid.ToString() + aaaastr] = DateTime.Now.ToString();
                Response.Redirect("~/Teacher/infomation.aspx", false);
            }
            else
            {
                if (Request.Cookies[LearnSite.Common.CookieHelp.mngCookieNname] != null)
                {
                    Response.Redirect("~/Manager/index.aspx", false);
                }
                else
                {
                    string msg = "本机cookies设置失效,无法登录!";
                    Labelmsg.Text = msg;
                }
            }
        }
    }
Пример #3
0
    protected void Btnedit_Click(object sender, EventArgs e)
    {
        string fckstr = mcontent.InnerText;

        if (fckstr != "")
        {
            if (Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname] != null)
            {
                string Mcidstr = Request.QueryString["Cid"].ToString();
                int    myCid   = Int32.Parse(Mcidstr);
                LearnSite.Model.Courses course = new LearnSite.Model.Courses();
                course.Cid      = myCid;
                course.Ctitle   = Texttitle.Text.Trim();
                course.Cclass   = DDLclass.SelectedValue;
                course.Ccontent = HttpUtility.HtmlEncode(fckstr);
                course.Cdate    = DateTime.Now;
                course.Cks      = Int32.Parse(DDLCks.SelectedValue);
                course.Cobj     = Int32.Parse(DDLcobj.SelectedValue);
                course.Cterm    = Int32.Parse(DDLCterm.SelectedValue);
                LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
                course.Chid     = tcook.Hid;
                course.Cpublish = CheckPublish.Checked;
                LearnSite.BLL.Courses coursebll = new LearnSite.BLL.Courses();
                coursebll.UpdateCourse(course);
                System.Threading.Thread.Sleep(500);
                string msg = "更新学案内容成功!";
                LearnSite.Common.MessageBox.Alert(msg, this.Page);
                string url = "~/Teacher/courseshow.aspx?Cid=" + myCid.ToString();
                Response.Redirect(url, false);
            }
        }
    }
Пример #4
0
    private void EditSoft()
    {
        if (Texttitle.Text != "" && ddlcategory.SelectedValue != "")
        {
            LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
            string Fhid = tcook.Hid.ToString();
            LearnSite.Model.Soft soft = new LearnSite.Model.Soft();
            string fid = Request.QueryString["Fid"].ToString();
            soft.Fid = Int32.Parse(fid);
            string fclass = DDLclass.SelectedValue;
            soft.Fclass = fclass;
            soft.Fup    = false;
            if (fclass == "教程" || fclass == "微课" || fclass == "课程")
            {
                soft.Fup = true;
            }
            soft.Fcontent  = HttpUtility.HtmlEncode(mcontent.InnerText);
            soft.Fdate     = DateTime.Now;
            soft.Fhit      = Int32.Parse(LabelFhit.Text);
            soft.Ftitle    = Texttitle.Text.Trim();
            soft.Ffiletype = LabelFfiletype.Text;
            soft.Furl      = Linkold.CommandArgument;
            soft.Fhide     = CheckBoxFhide.Checked;
            soft.Fopen     = Int32.Parse(DDLopen.SelectedValue);
            soft.Fyid      = Int32.Parse(ddlcategory.SelectedValue);
            if (!CheckBoxFhid.Checked)
            {
                soft.Fhid = Int32.Parse(Fhid);
            }
            else
            {
                soft.Fhid = -1;
            }
            if (soft.Ftitle != "" && soft.Fcontent != "")
            {
                if (FUsoft.PostedFile.FileName != "")
                {
                    string uploadfile = FUsoft.PostedFile.FileName;
                    soft.Ffiletype = uploadfile.Substring(uploadfile.LastIndexOf(".") + 1);
                    soft.Furl      = LearnSite.Common.Fileupload.Fupload(FUsoft);
                }
                LearnSite.BLL.Soft bll = new LearnSite.BLL.Soft();
                bll.Update(soft);

                Labelmsg.Text = "修改资源成功!";
                System.Threading.Thread.Sleep(500);
                string url = "~/Teacher/softview.aspx?Fid=" + fid;
                Response.Redirect(url, false);
            }
            else
            {
                Labelmsg.Text = "清添加资源内容介绍!";
            }
        }
        else
        {
            Labelmsg.Text = "请添加资源标题!";
        }
    }
Пример #5
0
    private void ShowMgid()
    {
        LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
        int hid = tcook.Hid;

        LearnSite.BLL.Gauge gbll = new LearnSite.BLL.Gauge();
        DDLMgid.DataSource     = gbll.GetListGauge(hid);
        DDLMgid.DataTextField  = "Gtitle";
        DDLMgid.DataValueField = "Gid";
        DDLMgid.DataBind();
    }
Пример #6
0
 protected void ButtonDel_Click(object sender, EventArgs e)
 {
     if (Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname] != null)
     {
         int Cid = Int32.Parse(Request.QueryString["Cid"].ToString());
         LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
         int Chid = tcook.Hid;
         LearnSite.BLL.Courses coursebll = new LearnSite.BLL.Courses();
         coursebll.DeleteCourse(Cid, Chid);
         System.Threading.Thread.Sleep(500);
         Response.Redirect("~/Teacher/course.aspx", false);
     }
 }
Пример #7
0
    private void ListTypeChinese()
    {
        LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
        string Hid = tcook.Hid.ToString();

        if (Session[Hid + "ChinesePageIndex"] != null)
        {
            GVType.PageIndex = Int32.Parse(Session[Hid + "ChinesePageIndex"].ToString());
        }
        LearnSite.BLL.Chinese bll = new LearnSite.BLL.Chinese();
        GVType.DataSource = bll.GetListTitle();
        GVType.DataBind();
    }
Пример #8
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 = "内容及标题不能为空!";
        }
    }
Пример #9
0
 protected void Btnadd_Click(object sender, EventArgs e)
 {
     if (Request.QueryString["Cid"] != null)
     {
         string Fcid     = Request.QueryString["Cid"].ToString();
         string Fcontent = HttpUtility.HtmlEncode(Request.Form["textareaItem"].Trim());
         Labelmsg.Text = "添加反思成功";
         LearnSite.Model.Flection flection = new LearnSite.Model.Flection();
         flection.Fcontent = Fcontent;
         flection.Fdate    = DateTime.Now;
         LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
         flection.Fhid = tcook.Hid;
         flection.Fcid = Int32.Parse(Fcid);
         LearnSite.BLL.Flection flectionbll = new LearnSite.BLL.Flection();
         flectionbll.Add(flection);
         System.Threading.Thread.Sleep(500);
         string url = "~/Lessons/thinkshow.aspx?Cid=" + Int32.Parse(Fcid);
         Response.Redirect(url, false);
     }
 }
Пример #10
0
    private void ShowCid()
    {
        LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
        int Hid = tcook.Hid;

        LabelGradeClass.Text = Request.QueryString["wGrade"].ToString() + "年级" + Request.QueryString["wClass"].ToString() + "班";
        int    Sgrade = Int32.Parse(Request.QueryString["wGrade"].ToString());
        int    Sclass = Int32.Parse(Request.QueryString["wClass"].ToString());
        string myCid  = Request.QueryString["wCid"].ToString();//直接url传递
        string cterm  = LearnSite.Common.XmlHelp.GetTerm();

        LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses();
        DDLCid.DataSource     = cbll.ShowCidCtitle(Hid, Sgrade, Int32.Parse(cterm));
        DDLCid.DataTextField  = "Ctitle";
        DDLCid.DataValueField = "Cid";
        DDLCid.DataBind();
        if (myCid != "")
        {
            DDLCid.SelectedValue = myCid;//设置为自动获取的今天本班学案Cid
        }
    }
Пример #11
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 = "内容及标题不能为空!";
            }
        }
    }
Пример #12
0
    protected void GVType_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView theGrid      = sender as GridView; // refer to the GridView
        int      newPageIndex = 0;

        if (-2 == e.NewPageIndex)
        { // when click the "GO" Button
            TextBox txtNewPageIndex = null;

            GridViewRow pagerRow = theGrid.BottomPagerRow;

            if (null != pagerRow)
            {
                txtNewPageIndex = pagerRow.FindControl("txtNewPageIndex") as TextBox;   // refer to the TextBox with the NewPageIndex value
            }

            if (null != txtNewPageIndex)
            {
                newPageIndex = int.Parse(txtNewPageIndex.Text) - 1; // get the NewPageIndex
            }
        }
        else
        {  // when click the first, last, previous and next Button
            newPageIndex = e.NewPageIndex;
        }

        // check to prevent form the NewPageIndex out of the range
        newPageIndex      = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex      = newPageIndex >= theGrid.PageCount ? theGrid.PageCount - 1 : newPageIndex;
        theGrid.PageIndex = newPageIndex;
        LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook();
        string Hid = tcook.Hid.ToString();

        Session[Hid + "ChinesePageIndex"] = newPageIndex;
        ListTypeChinese();
    }
Пример #13
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 = "内容及标题不能为空!";
        }
    }