Exemplo n.º 1
0
 protected void Btnedit_Click(object sender, EventArgs e)
 {
     string fckstr = FCKeditor1.Value;
         if (fckstr != "")
         {
             if (Request.Cookies["TeacherCookies"] != null)
             {
                 string serverUrl=LearnSite.Common.WordProcess.ServerUrl();
                 fckstr = fckstr.Replace(serverUrl, "");
                 LearnSite.Model.Courses course = new LearnSite.Model.Courses();
                 course.Cid = GetCid;
                 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);
                 course.Chid = Int32.Parse(Request.Cookies["TeacherCookies"].Values["Hid"].ToString());
                 course.Cpublish = CheckPublish.Checked;
                 LearnSite.BLL.Courses coursebll = new LearnSite.BLL.Courses();
                 coursebll.UpdateCourse(course);
                 System.Threading.Thread.Sleep(1500);
                 string msg = "更新课程内容成功!";
                 LearnSite.Common.MessageBox.Alert(msg, this.Page);
                 string Cid = Request.QueryString["Cid"].ToString();
                 string url = "~/Teacher/courseshow.aspx?Cid=" + Cid;
                 Response.Redirect(url, false);
             }
        }
 }
Exemplo n.º 2
0
 protected void BtnCreate_Click(object sender, EventArgs e)
 {
     if (Request.Cookies["TeacherCookies"] != null)
     {
         if (Texttitle.Text != "")
         {
             string ctitle = Texttitle.Text.Trim();
             LearnSite.Model.Courses course = new LearnSite.Model.Courses();
             course.Ctitle = Texttitle.Text;
             course.Cclass = DDLclass.SelectedValue;
             course.Cobj = Int32.Parse(DDLcobj.SelectedValue);
             course.Cterm = Int32.Parse(LearnSite.Common.XmlHelp.GetTerm());
             course.Cks = Int32.Parse(DDLCks.SelectedValue);
             course.Chid = Int32.Parse(Request.Cookies["TeacherCookies"].Values["Hid"].ToString());//教师编号
             course.Cdate = DateTime.Now;
             course.Cpublish = Checkcpublish.Checked;
             LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses();
             int GetCid = cbll.Create(course);
             Labelmsg.Text = GetCid.ToString();
             if (GetCid > 0)
             {
                 string urlstr = "~/Teacher/courseedit.aspx?Cid=" + GetCid;
                 Response.Redirect(urlstr, false);
             }
             else
             {
                 Labelmsg.Text = "创建新课程失败!";
             }
         }
         else
         {
             Labelmsg.Text = "请输入新建课程名称!";
         }
     }
 }
Exemplo n.º 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);
                course.Chid     = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname].Values["Hid"].ToString());
                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);
            }
        }
    }
Exemplo n.º 4
0
    private void ShowCourse()
    {
        string Cid = Request.QueryString["Cid"].ToString();

        if (LearnSite.Common.WordProcess.IsNum(Cid))
        {
            LearnSite.Model.Courses model = new LearnSite.Model.Courses();
            LearnSite.BLL.Courses   cs    = new LearnSite.BLL.Courses();
            model = cs.GetModel(Int32.Parse(Cid));
            if (model != null)
            {
                LabelCtitle.Text   = model.Ctitle;
                LabelCdate.Text    = model.Cdate.ToString();
                LabelCclass.Text   = model.Cclass;
                LabelCobj.Text     = model.Cobj.ToString();
                LabelCterm.Text    = model.Cterm.ToString();
                LabelCks.Text      = model.Cks.ToString();
                Ccontent.InnerHtml = HttpUtility.HtmlDecode(model.Ccontent);
            }
            else
            {
                Ccontent.InnerHtml = "此学案不存在!";
            }
            LabelWelcome.Text = "您好,欢迎开始本课旅程!";
        }
    }
Exemplo n.º 5
0
 private void ShowCourseFiled()
 {
     if (Request.QueryString["Mcid"] != null)
     {
         int Mcid = Int32.Parse(Request.QueryString["Mcid"].ToString());
         LearnSite.BLL.Courses   cbll   = new LearnSite.BLL.Courses();
         LearnSite.Model.Courses cmodel = new LearnSite.Model.Courses();
         cmodel = cbll.GetModel(Mcid);
         DDLmfiletype.SelectedValue = cmodel.Cfiletype;
     }
 }
Exemplo n.º 6
0
    private void Showcourse()
    {
        int myCid = Int32.Parse(Request.QueryString["Cid"].ToString());

        LearnSite.Model.Courses course = new LearnSite.Model.Courses();
        LearnSite.BLL.Courses   cbll   = new LearnSite.BLL.Courses();
        course                 = cbll.GetModel(myCid);
        Texttitle.Text         = course.Ctitle;
        DDLclass.SelectedValue = course.Cclass;
        DDLcobj.SelectedValue  = course.Cobj.ToString();
        DDLCterm.SelectedValue = course.Cterm.ToString();
        DDLCks.SelectedValue   = course.Cks.ToString();
        mcontent.InnerText     = HttpUtility.HtmlDecode(course.Ccontent);
        CheckPublish.Checked   = course.Cpublish;
    }
Exemplo n.º 7
0
 private void showcourse()
 {
     if (Request.QueryString["Cid"] != null)
     {
         string Cid = Request.QueryString["Cid"].ToString();
         LearnSite.Model.Courses model = new LearnSite.Model.Courses();
         LearnSite.BLL.Courses   cs    = new LearnSite.BLL.Courses();
         model = cs.GetModel(Int32.Parse(Cid));
         if (model != null)
         {
             LabelCtitle.Text   = model.Ctitle;
             LabelCdate.Text    = model.Cdate.ToString();
             LabelCclass.Text   = model.Cclass;
             LabelCobj.Text     = model.Cobj.ToString();
             LabelCterm.Text    = model.Cterm.ToString();
             LabelCks.Text      = model.Cks.ToString();
             Ccontent.InnerHtml = HttpUtility.HtmlDecode(model.Ccontent);
         }
     }
 }
Exemplo n.º 8
0
 private void showcourse(string Cid)
 {
     if (LearnSite.Common.WordProcess.IsNum(Cid))
     {
         LearnSite.Model.Courses model = new LearnSite.Model.Courses();
         LearnSite.BLL.Courses cs = new LearnSite.BLL.Courses();
         model = cs.GetModel(Int32.Parse(Cid));
         if (model != null)
         {
             LabelCtitle.Text = model.Ctitle;
             LabelCdate.Text = model.Cdate.ToString();
             LabelCclass.Text = model.Cclass;
             LabelCobj.Text = model.Cobj.ToString();
             LabelCterm.Text = model.Cterm.ToString();
             LabelCks.Text = model.Cks.ToString();
             Ccontent.InnerHtml = HttpUtility.HtmlDecode(model.Ccontent);
             LearnSite.BLL.Mission mission = new LearnSite.BLL.Mission();
             GVmission.DataSource = mission.GetMissions(Int32.Parse(Cid));
             GVmission.DataBind();
         }
     }
 }
Exemplo n.º 9
0
 private void ShowCourse()
 {
     string Cid = Request.QueryString["Cid"].ToString();
     if (LearnSite.Common.WordProcess.IsNum(Cid))
     {
         LearnSite.Model.Courses model = new LearnSite.Model.Courses();
         LearnSite.BLL.Courses cs = new LearnSite.BLL.Courses();
         model = cs.GetModel(Int32.Parse(Cid));
         if (model != null)
         {
             LabelCtitle.Text = model.Ctitle;
             LabelCdate.Text = model.Cdate.ToString();
             LabelCclass.Text = model.Cclass;
             LabelCobj.Text = model.Cobj.ToString();
             LabelCterm.Text = model.Cterm.ToString();
             LabelCks.Text = model.Cks.ToString();
             Ccontent.InnerHtml = HttpUtility.HtmlDecode(model.Ccontent);
         }
         else
         {
             Ccontent.InnerHtml = "此课程不存在!";
         }
     }
 }
Exemplo n.º 10
0
 protected void BtnCreate_Click(object sender, EventArgs e)
 {
     if (Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname] != null)
     {
         if (Texttitle.Text != "")
         {
             string ctitle = Texttitle.Text.Trim();
             LearnSite.Model.Courses course = new LearnSite.Model.Courses();
             course.Ctitle   = Texttitle.Text;
             course.Cclass   = DDLclass.SelectedValue;
             course.Cobj     = Int32.Parse(DDLcobj.SelectedValue);
             course.Cterm    = Int32.Parse(LearnSite.Common.XmlHelp.GetTerm());
             course.Cks      = Int32.Parse(DDLCks.SelectedValue);
             course.Chid     = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname].Values["Hid"].ToString());//教师编号
             course.Cdate    = DateTime.Now;
             course.Cpublish = Checkcpublish.Checked;
             LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses();
             int GetCid = cbll.Create(course);
             Labelmsg.Text = GetCid.ToString();
             if (GetCid > 0)
             {
                 LearnSite.Store.CourseStore.CreateStore(GetCid);//创建新学案时,同时创建学案保存路径
                 string urlstr = "~/Teacher/courseedit.aspx?Cid=" + GetCid;
                 Response.Redirect(urlstr, false);
             }
             else
             {
                 Labelmsg.Text = "创建新学案失败!";
             }
         }
         else
         {
             Labelmsg.Text = "请输入新建学案名称!";
         }
     }
 }
Exemplo n.º 11
0
 private void ShowCourseFiled()
 {
     if (Request.QueryString["Mcid"] != null)
     {
         int Mcid = Int32.Parse(Request.QueryString["Mcid"].ToString());
         LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses();
         LearnSite.Model.Courses cmodel = new LearnSite.Model.Courses();
         cmodel = cbll.GetModel(Mcid);
         DDLmfiletype.SelectedValue = cmodel.Cfiletype;
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LearnSite.Model.Courses model)
 {
     return(dal.Add(model));
 }
Exemplo n.º 13
0
 /// <summary>
 /// 创建新学案(Ctitle,Cclass,Cdate,Cobj,Cterm,Cks,Cfiletype,Cupload,Cpublish),返回自动编号
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int Create(LearnSite.Model.Courses model)
 {
     return(dal.Create(model));
 }
Exemplo n.º 14
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<LearnSite.Model.Courses> DataTableToList(DataTable dt)
 {
     List<LearnSite.Model.Courses> modelList = new List<LearnSite.Model.Courses>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         LearnSite.Model.Courses model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new LearnSite.Model.Courses();
             if(dt.Rows[n]["Cid"].ToString()!="")
             {
                 model.Cid=int.Parse(dt.Rows[n]["Cid"].ToString());
             }
             model.Ctitle=dt.Rows[n]["Ctitle"].ToString();
             model.Cclass=dt.Rows[n]["Cclass"].ToString();
             model.Ccontent=dt.Rows[n]["Ccontent"].ToString();
             if(dt.Rows[n]["Cdate"].ToString()!="")
             {
                 model.Cdate=DateTime.Parse(dt.Rows[n]["Cdate"].ToString());
             }
             if(dt.Rows[n]["Chit"].ToString()!="")
             {
                 model.Chit=int.Parse(dt.Rows[n]["Chit"].ToString());
             }
             if(dt.Rows[n]["Cobj"].ToString()!="")
             {
                 model.Cobj=int.Parse(dt.Rows[n]["Cobj"].ToString());
             }
             if(dt.Rows[n]["Cterm"].ToString()!="")
             {
                 model.Cterm=int.Parse(dt.Rows[n]["Cterm"].ToString());
             }
             if(dt.Rows[n]["Cks"].ToString()!="")
             {
                 model.Cks=int.Parse(dt.Rows[n]["Cks"].ToString());
             }
             model.Cfiletype=dt.Rows[n]["Cfiletype"].ToString();
             if(dt.Rows[n]["Cupload"].ToString()!="")
             {
                 if((dt.Rows[n]["Cupload"].ToString()=="1")||(dt.Rows[n]["Cupload"].ToString().ToLower()=="true"))
                 {
                 model.Cupload=true;
                 }
                 else
                 {
                     model.Cupload=false;
                 }
             }
             if(dt.Rows[n]["Chid"].ToString()!="")
             {
                 model.Chid=int.Parse(dt.Rows[n]["Chid"].ToString());
             }
             if(dt.Rows[n]["Cpublish"].ToString()!="")
             {
                 if((dt.Rows[n]["Cpublish"].ToString()=="1")||(dt.Rows[n]["Cpublish"].ToString().ToLower()=="true"))
                 {
                 model.Cpublish=true;
                 }
                 else
                 {
                     model.Cpublish=false;
                 }
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
Exemplo n.º 15
0
 /// <summary>
 /// 更新一条数据,更新学案内容
 /// </summary>
 public void UpdateCourse(LearnSite.Model.Courses model)
 {
     dal.UpdateCourse(model);
 }
Exemplo n.º 16
0
 private void Showcourse()
 {
     LearnSite.Model.Courses course = new LearnSite.Model.Courses();
         LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses();
         course = cbll.GetModel(GetCid);
         Texttitle.Text = course.Ctitle;
         DDLclass.SelectedValue = course.Cclass;
         DDLcobj.SelectedValue = course.Cobj.ToString();
         DDLCterm.SelectedValue = course.Cterm.ToString();
         DDLCks.SelectedValue = course.Cks.ToString();
         FCKeditor1.Value =HttpUtility.HtmlDecode( course.Ccontent);
         CheckPublish.Checked = course.Cpublish;
 }
Exemplo n.º 17
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LearnSite.Model.Courses> DataTableToList(DataTable dt)
        {
            List <LearnSite.Model.Courses> modelList = new List <LearnSite.Model.Courses>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LearnSite.Model.Courses model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LearnSite.Model.Courses();
                    if (dt.Rows[n]["Cid"].ToString() != "")
                    {
                        model.Cid = int.Parse(dt.Rows[n]["Cid"].ToString());
                    }
                    model.Ctitle   = dt.Rows[n]["Ctitle"].ToString();
                    model.Cclass   = dt.Rows[n]["Cclass"].ToString();
                    model.Ccontent = dt.Rows[n]["Ccontent"].ToString();
                    if (dt.Rows[n]["Cdate"].ToString() != "")
                    {
                        model.Cdate = DateTime.Parse(dt.Rows[n]["Cdate"].ToString());
                    }
                    if (dt.Rows[n]["Chit"].ToString() != "")
                    {
                        model.Chit = int.Parse(dt.Rows[n]["Chit"].ToString());
                    }
                    if (dt.Rows[n]["Cobj"].ToString() != "")
                    {
                        model.Cobj = int.Parse(dt.Rows[n]["Cobj"].ToString());
                    }
                    if (dt.Rows[n]["Cterm"].ToString() != "")
                    {
                        model.Cterm = int.Parse(dt.Rows[n]["Cterm"].ToString());
                    }
                    if (dt.Rows[n]["Cks"].ToString() != "")
                    {
                        model.Cks = int.Parse(dt.Rows[n]["Cks"].ToString());
                    }
                    model.Cfiletype = dt.Rows[n]["Cfiletype"].ToString();
                    if (dt.Rows[n]["Cupload"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Cupload"].ToString() == "1") || (dt.Rows[n]["Cupload"].ToString().ToLower() == "true"))
                        {
                            model.Cupload = true;
                        }
                        else
                        {
                            model.Cupload = false;
                        }
                    }
                    if (dt.Rows[n]["Chid"].ToString() != "")
                    {
                        model.Chid = int.Parse(dt.Rows[n]["Chid"].ToString());
                    }
                    if (dt.Rows[n]["Cpublish"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Cpublish"].ToString() == "1") || (dt.Rows[n]["Cpublish"].ToString().ToLower() == "true"))
                        {
                            model.Cpublish = true;
                        }
                        else
                        {
                            model.Cpublish = false;
                        }
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 18
0
    private void ShowCourseInfo()
    {
        if (Request.QueryString["Cid"] != null)
        {
            int Cid = Int32.Parse(Request.QueryString["Cid"].ToString());
            LearnSite.Model.Courses course = new LearnSite.Model.Courses();
            LearnSite.BLL.Courses   bll    = new LearnSite.BLL.Courses();
            course          = bll.GetModel(Cid);
            Labeltitle.Text = course.Ctitle;
            //Wid,Wurl,Wname,Wscore
            LearnSite.BLL.Works wbll   = new LearnSite.BLL.Works();
            DataTable           dt     = wbll.GetCourseWorks(Cid);
            DataTable           dtgood = dt.Clone();
            int     count  = dt.Rows.Count;
            int     g      = 0;
            int     a      = 0;
            int     b      = 0;
            int     c      = 0;
            int     d      = 0;
            int     e      = 0;
            int     f      = 0;
            decimal all    = 0;
            decimal averge = 0;
            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    int wscore = Int32.Parse(dt.Rows[i][3].ToString());
                    all += wscore;
                    switch (wscore)
                    {
                    case 12:
                        g++;
                        dtgood.ImportRow(dt.Rows[i]);
                        break;

                    case 10:
                        a++;
                        break;

                    case 8:
                        b++;
                        break;

                    case 6:
                        c++;
                        break;

                    case 4:
                        d++;
                        break;

                    case 2:
                        e++;
                        break;

                    case 0:
                        f++;
                        break;
                    }
                }
                averge = all / count;

                DDLstore.DataSource     = dtgood;
                DDLstore.DataTextField  = "Wname";
                DDLstore.DataValueField = "Wurl";
                DDLstore.DataBind();
                lbcount.Text = count.ToString();
                if (DDLstore.Items.Count > 0)
                {
                    DDLstore.SelectedIndex = 0;
                    ShowFlash();
                    divview.Visible = true;
                }
                else
                {
                    Literal1.Text = "暂无评分G的收藏作品!";
                }
            }
            Labeldistribution.Text = "作品总数:" + count + " 评分分布:G " + g + " . A " + a + " . B " + b + " . C " + c + " . D " + d + " . E" + e + " 作品均分:" + averge.ToString("f1");
            dt.Dispose();
        }
    }