Beispiel #1
0
        public void Add(HelpPage page)
        {
            page.Hash = TextHash.MD5(page.Path).Value;

            HelpPageDao dao = new HelpPageDao();
            using (Transaction tx = new Transaction())
            {
                dao.Save<HelpPage>(page);
                tx.Commit();
            }
        }
Beispiel #2
0
        public static Data.Model.Help.HelpPage GetCurrent()
        {
            WebRequestContext context = new WebRequestContext();

            CmsUrl url = WebRequestContext.CurrentPage();
            Data.Hash hash = TextHash.MD5(url.Path);

            HelpPageDao dao = new HelpPageDao();
            HelpPage result = dao.FindByPageHash(hash);

            if (result != null)
            {
                String separator = "?";
                String path = context.Request.Url.PathAndQuery;
                if (path.Contains("?"))
                    separator = "&";

                path = path + separator + "hide=1";
                result.Text = result.Text.Replace("{action}", path);
            }
            return result;
        }
Beispiel #3
0
 public IList<HelpPage> GetAll()
 {
     HelpPageDao dao = new HelpPageDao();
     return dao.FindAll<HelpPage>();
 }
Beispiel #4
0
 public HelpPage Get(int id)
 {
     HelpPageDao dao = new HelpPageDao();
     return dao.FindByPrimaryKey<HelpPage>(id);
 }