Example #1
0
 protected void btnSaveHTML_Click(object sender, EventArgs e)
 {
     string CID = this.Request.QueryString["cid"].ToString();
     string IID = this.Request.QueryString["iid"].ToString();
     int courseid;
     int Itemid;
     if (int.TryParse(CID, out courseid) && int.TryParse(IID, out Itemid)) //check is number...
     {
         BaseHandler bh = new BaseHandler();
         List<CourseItemComment> objCourseItemComment = (List<CourseItemComment>)bh.GetCourseItemComment(courseid, Itemid);
         if (objCourseItemComment.Count > 0)
         {
             objCourseItemComment[0].HtmlText = hdHTML.Value;
             bh.UpdateCourseItemComment(objCourseItemComment[0]);
            labHtmlText.Text= objCourseItemComment[0].HtmlText  ;
         }
     }
 }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (Request.QueryString["cid"] != null && !string.IsNullOrWhiteSpace(Request.QueryString["cid"])
                        && Request.QueryString["iid"] != null && !string.IsNullOrWhiteSpace(Request.QueryString["iid"]))
                    {
                        string CID = this.Request.QueryString["cid"].ToString();
                        string IID = this.Request.QueryString["iid"].ToString();
                        int courseid;
                        int Itemid;
                        if (int.TryParse(CID, out courseid) && int.TryParse(IID, out Itemid)) //check is number...
                        {
                            BaseHandler bh = new BaseHandler();
                            List<CourseItemComment> objCourseItemComment = (List<CourseItemComment>)bh.GetCourseItemComment(courseid, Itemid);
                            if (objCourseItemComment.Count > 0)
                            {
                                labHtmlText.Text = objCourseItemComment[0].HtmlText;
                            }
                        }

                    }
                    else
                    {
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "StartupScriptforTree",
                            "alert('Please Select Course');", true);
                    }

                    string editQS = Request.QueryString["edit"];
                    if (editQS != null && !string.IsNullOrWhiteSpace(editQS) && editQS.ToLower() == "true" )
                    {
                        btnEditHTML.Style.Add("display", "block");
                    }
                    else
                    {
                        btnEditHTML.Style.Add("display", "none");
                    }

                }
                catch (Exception exc) //Module failed to load
                {
                    Exceptions.ProcessModuleLoadException(this, exc);
                }
            }
        }
Example #3
0
 public void BindTree(int courseId)
 {
     BaseHandler bh = new BaseHandler();
     List<CourseItem> tree = (List<CourseItem>)bh.GetCourseItemsAsTree(courseId);
     PopulateTreeNodes(tree, TreeViewMain.Nodes);
 }
Example #4
0
 private void PopulateTreeNodes(List<CourseItem> LstCourseItem, TreeNodeCollection RootNodes)
 {
     foreach (CourseItem ObjCourseItem in LstCourseItem)
     {
         TreeNode NodeToAdd = new TreeNode();
         if (ObjCourseItem.ItemType.ToString() == ECourseItemType.Plugg.ToString())
         {
             BaseHandler plugghandler = new BaseHandler();
             PluggContainer p = new PluggContainer();
             p.ThePlugg = plugghandler.GetPlugg(ObjCourseItem.ItemId);
             string curlan = (Page as PageBase).PageCulture.Name;
             p.CultureCode = curlan;
             p.LoadTitle();
             NodeToAdd.Text = "<a  style='text-decoration: underline;cursor: pointer; ' href='/" + ObjCourseItem.ItemId + "' >" + p.TheTitle.Text + "</a>";
         }
         else
         {
             NodeToAdd.Text = Convert.ToString(ObjCourseItem.label);
         }
         NodeToAdd.SelectAction = TreeNodeSelectAction.None;
         RootNodes.Add(NodeToAdd);
         if (ObjCourseItem.children != null)
             PopulateTreeNodes((List<CourseItem>)ObjCourseItem.children, NodeToAdd.ChildNodes);
     }
 }
Example #5
0
        private PluggContainer GetPluggContainer(string curlan)
        {
            BaseHandler plugghandler = new BaseHandler();
            int pluggid = Convert.ToInt32(((DotNetNuke.Framework.CDefault)this.Page).Title);

            PluggContainer p = new PluggContainer();
            p.ThePlugg = plugghandler.GetPlugg(pluggid);
            p.CultureCode = curlan;
            p.LoadTitle();
            return p;
        }
Example #6
0
 //public void bindgrid()
 //{
 //    BaseHandler ph = new BaseHandler();
 //    //var pc = new PluggController();
 //    DnnGrid dgDNNGrid;
 //    dgDNNGrid = new DnnGrid();
 //    dgDNNGrid.AutoGenerateColumns = true;
 //    dgDNNGrid.CellSpacing = 0;
 //    dgDNNGrid.GridLines = GridLines.Both;
 //    dgDNNGrid.FooterStyle.CssClass = "DataGrid_Footer";
 //    dgDNNGrid.HeaderStyle.CssClass = "DataGrid_Header";
 //    dgDNNGrid.ItemStyle.CssClass = "DataGrid_Item";
 //    dgDNNGrid.AlternatingItemStyle.CssClass = "DataGrid_AlternatingItem";
 //    dgDNNGrid.AllowSorting = true;
 //    dgDNNGrid.AllowPaging = true;
 //    dgDNNGrid.PagerStyle.Mode = Telerik.Web.UI.GridPagerMode.Slider;
 //    dgDNNGrid.DataSource = ph.GetPluggListForGrid();
 //    dgDNNGrid.DataBind();
 //    //pnlGrid.Controls.Add(dgDNNGrid);
 //}
 public void bindRadGrid()
 {
     BaseHandler ph = new BaseHandler();
     RadGrid_ViewPlugg.DataSource = ph.GetPluggListForGrid("en-US");
 }
Example #7
0
 public void bindRadGrid()
 {
     BaseHandler ch = new BaseHandler();
     RadGrid_ViewPlugg.DataSource = ch.GetCoursesForDNN();
 }