public List<SiteMapOrder> CreateSiteMapList(string sMapText)
        {
            List<SiteMapOrder> m = new List<SiteMapOrder>();
            sMapText = sMapText.Trim();

            if (!String.IsNullOrEmpty(sMapText)) {
                sMapText = sMapText.Replace("\r\n", "\n");
                var rows = sMapText.Split('\n');
                foreach (string r in rows) {
                    if (!String.IsNullOrEmpty(r)) {
                        var rr = r.Split('\t');
                        SiteMapOrder s = new SiteMapOrder();
                        s.NavOrder = int.Parse(rr[0]);
                        s.Parent_ContentID = new Guid(rr[1]);
                        s.Root_ContentID = new Guid(rr[2]);
                        if (s.Parent_ContentID == Guid.Empty) {
                            s.Parent_ContentID = null;
                        }
                        m.Add(s);
                    }
                }
            }

            return m;
        }
		public List<SiteMapOrder> ParseChildPageData(string sMapText, Guid contentID) {
			List<SiteMapOrder> m = new List<SiteMapOrder>();
			sMapText = sMapText.Trim();

			carrot_Content c = (from ct in db.carrot_Contents
								where ct.Root_ContentID == contentID
								   && ct.IsLatestVersion == true
								select ct).FirstOrDefault();

			int iOrder = Convert.ToInt32(c.NavOrder) + 2;

			if (!string.IsNullOrEmpty(sMapText)) {
				sMapText = sMapText.Replace("\r\n", "\n");
				var rows = sMapText.Split('\n');
				foreach (string r in rows) {
					if (!string.IsNullOrEmpty(r)) {
						var rr = r.Split('\t');
						SiteMapOrder s = new SiteMapOrder();
						s.NavOrder = iOrder + int.Parse(rr[0]);
						s.Root_ContentID = new Guid(rr[1]);
						s.Parent_ContentID = contentID;
						m.Add(s);
					}
				}
			}

			return m;
		}
        public List <SiteMapOrder> ParseChildPageData(string sMapText, Guid contentID)
        {
            List <SiteMapOrder> m = new List <SiteMapOrder>();

            sMapText = sMapText.Trim();

            carrot_Content c = (from ct in db.carrot_Contents
                                where ct.Root_ContentID == contentID &&
                                ct.IsLatestVersion == true
                                select ct).FirstOrDefault();

            int iOrder = Convert.ToInt32(c.NavOrder) + 2;

            if (!String.IsNullOrEmpty(sMapText))
            {
                sMapText = sMapText.Replace("\r\n", "\n");
                var rows = sMapText.Split('\n');
                foreach (string r in rows)
                {
                    if (!String.IsNullOrEmpty(r))
                    {
                        var          rr = r.Split('\t');
                        SiteMapOrder s  = new SiteMapOrder();
                        s.NavOrder         = iOrder + int.Parse(rr[0]);
                        s.Root_ContentID   = new Guid(rr[1]);
                        s.Parent_ContentID = contentID;
                        m.Add(s);
                    }
                }
            }

            return(m);
        }
        public List <SiteMapOrder> CreateSiteMapList(string sMapText)
        {
            List <SiteMapOrder> m = new List <SiteMapOrder>();

            sMapText = sMapText.Trim();

            if (!String.IsNullOrEmpty(sMapText))
            {
                sMapText = sMapText.Replace("\r\n", "\n");
                var rows = sMapText.Split('\n');
                foreach (string r in rows)
                {
                    if (!String.IsNullOrEmpty(r))
                    {
                        var          rr = r.Split('\t');
                        SiteMapOrder s  = new SiteMapOrder();
                        s.NavOrder         = int.Parse(rr[0]);
                        s.Parent_ContentID = new Guid(rr[1]);
                        s.Root_ContentID   = new Guid(rr[2]);
                        if (s.Parent_ContentID == Guid.Empty)
                        {
                            s.Parent_ContentID = null;
                        }
                        m.Add(s);
                    }
                }
            }

            return(m);
        }
Example #5
0
        public SiteMapOrder GetPageWithLevel(Guid siteID, Guid?contentID, int iLevel)
        {
            SiteMapOrder cont = (from ct in CompiledQueries.cqGetLatestContentPages(db, siteID, contentID).ToList()
                                 select new SiteMapOrder {
                NavLevel = iLevel,
                NavMenuText = (ct.PageActive ? "" : "{*U*} ") + ct.NavMenuText,
                NavOrder = ct.NavOrder,
                SiteID = ct.SiteID,
                FileName = ct.FileName,
                PageActive = Convert.ToBoolean(ct.PageActive),
                Parent_ContentID = ct.Parent_ContentID,
                Root_ContentID = ct.Root_ContentID
            }).FirstOrDefault();

            return(cont);
        }
 public override bool Equals(Object obj)
 {
     //Check for null and compare run-time types.
     if (obj == null || GetType() != obj.GetType())
     {
         return(false);
     }
     if (obj is SiteMapOrder)
     {
         SiteMapOrder p = (SiteMapOrder)obj;
         return(this.Root_ContentID == p.Root_ContentID);
     }
     else
     {
         return(false);
     }
 }