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 = "请输入新建课程名称!";
         }
     }
 }
 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 = "请输入新建学案名称!";
         }
     }
 }