Exemplo n.º 1
0
 private void CreateCourse()
 {
     string cultureCode = (Page as DotNetNuke.Framework.PageBase).PageCulture.Name;
     CourseContainer cc = new CourseContainer(cultureCode);
     cc.TheCourse.CreatedByUserId = UserId;
     cc.TheCourse.ModifiedByUserId = UserId;
     cc.TheCourse.CourseId = 0;
     cc.TheCourse.CreatedInCultureCode = cultureCode;
     cc.SetTitle(Regex.Replace(nvc["Title"], "<[^>]*>", String.Empty));
     //string subjectStr = Page.Request.QueryString["s"];
     //if (subjectStr != null)
     //{
     //    int subid = Convert.ToInt32(subjectStr);
     //    pc.ThePlugg.SubjectId = subid;
     //}
     //else
     //    pc.ThePlugg.SubjectId = 0;
     cc.TheCourse.SubjectId = 0;
     if (nvc["Description"] != "")
         cc.SetDescription(Regex.Replace(nvc["Description"], "<[^>]*>", String.Empty));
     cc.TheCourse.WhoCanEdit = EWhoCanEdit.Anyone;
     BaseHandler bh = new BaseHandler();
     bh.CreateCourse(cc);
     Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(cc.TheCourse.TabId, "", "edit=0"));
 }
Exemplo n.º 2
0
 protected void btnTitleSave_Click(object sender, EventArgs e)
 {
     ETextItemType ItemType = ETextItemType.CourseTitle;
     string txt = txttitle.Text;
     pnlCourseCom.Visible = true;
     if (EditStr == "2")
     {
         UpdatePHtext(ItemType, txt);
     }
     else
     {
         BaseHandler bh = new BaseHandler();
         cc.LoadTitle();
         cc.TheTitle.Text = txt;
         bh.CreateCourse(cc);
     }
     Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", new string[] { "edit=" + EditStr, "language=" + curlan }));
 }
Exemplo n.º 3
0
        protected CourseContainer SaveCourse()
        {
            BaseHandler bh = new BaseHandler();
            CourseContainer cc = new CourseContainer(new Localization().CurrentCulture);
            List<CourseItemEntity> cis = new List<CourseItemEntity>();
            ReadFromControls(cc, cis);
            try
            {
                bh.CreateCourse(cc);  //Create CoursePage, Course and CourseItems (only Pluggs)
            }
            catch (Exception ex)
            {
                lblError.Text = "Failed to create a Course: " + ex.Message;
                Exceptions.LogException(ex);
                cc.TheCourse.CourseId = 0;
            }

            return cc;
        }
Exemplo n.º 4
0
        protected void btnSelSub_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(hdnNodeSubjectId.Value))
            {
                int id = Convert.ToInt32(hdnNodeSubjectId.Value);

                BaseHandler plugghandler = new BaseHandler();
                cc.TheCourse.SubjectId = id;
                cc.LoadTitle();
                List<object> blankList = new List<object>();
                BaseHandler bh = new BaseHandler();
                try
                {
                    bh.CreateCourse(cc);
                }
                catch (Exception)
                {
                }
            }

            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", new string[] { "edit=" + EditStr, "language=" + curlan }));
        }