Example #1
0
 protected void btnRemoveSelectedPlugg_Click(object sender, EventArgs e)
 {
     BaseHandler bh = new BaseHandler();
     CoursePlugg cp = bh.FindCoursePlugg(Language, CourseId, Convert.ToInt32(hdnNodeCPId.Value));
     if (cp.children.Count == 0)
     {
         bh.DeleteCP(Convert.ToInt32(hdnNodeCPId.Value));
         lblCannotDelete.Visible = false;
     }
     else
         lblCannotDelete.Visible = true;
     BindTree();
 }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    BaseHandler bh = new BaseHandler();
                    CultureCode = (Page as DotNetNuke.Framework.PageBase).PageCulture.Name;
                    PluggId = Convert.ToInt32(((DotNetNuke.Framework.CDefault)this.Page).Title);

                    string coursePluggIdStr = Page.Request.QueryString["cp"];
                    if (coursePluggIdStr == null)    //This is a Plugg outside a course: no menu
                        return;

                    bool isNum = int.TryParse(coursePluggIdStr, out CoursePluggId);
                    if (!isNum)
                        return;

                    currentCPE = bh.GetCPEntity(CoursePluggId);
                    if (currentCPE == null)
                        return;
                    CourseId = currentCPE.CourseId;
                    cc = new CourseContainer(CultureCode, CourseId);
                    if (cc == null)
                        return;
                    pnlTitle.Visible = true;
                    hlBackToCourse.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(cc.TheCourse.TabId, "", "");
                    cc.LoadPluggs();
                    CoursePlugg currentCP = bh.FindCoursePlugg(CultureCode, CourseId, CoursePluggId);
                    CoursePlugg nextCP = bh.NextCoursePlugg(currentCP);
                    if (nextCP != null)
                    {
                        PluggContainer p = new PluggContainer(CultureCode, nextCP.PluggId);
                        lnkNextPlugg.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(p.ThePlugg.TabId, "", "cp=" + nextCP.CoursePluggId );
                    }
                    else
                    {
                        lnkNextPlugg.Enabled = false;
                    }

                    PopulateTreeNodes((List<CoursePlugg>)cc.ThePluggs, TreeViewMain.Nodes);
                }

            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }