Ejemplo n.º 1
0
        public static String GetDefaultPagePath(
            Guid userGuid,
            SiteSettings siteSettings,
            String defaultFirstPageName,
            String deafaultFirstPagePath)
        {
            String result       = String.Empty;
            int    countOfPages = 0;

            using (IDataReader reader = DBUserPage.SelectByUser(userGuid))
            {
                while ((reader.Read()) && (countOfPages < 1))
                {
                    result  = reader["PagePath"].ToString();
                    result += 1;
                }
            }

            if (result == String.Empty)
            {
                UserPage userPage = new UserPage();
                userPage.SiteId    = siteSettings.SiteId;
                userPage.SiteGuid  = siteSettings.SiteGuid;
                userPage.UserGuid  = userGuid;
                userPage.PageName  = defaultFirstPageName;
                userPage.PagePath  = deafaultFirstPagePath;
                userPage.PageOrder = 1;
                userPage.Save();

                result = deafaultFirstPagePath;
            }


            return(result);
        }
Ejemplo n.º 2
0
        public static int GetCountByUser(Guid userGuid)
        {
            int result = 0;

            using (IDataReader reader = DBUserPage.SelectByUser(userGuid))
            {
                while (reader.Read())
                {
                    result += 1;
                }
            }

            return(result);
        }
Ejemplo n.º 3
0
 public static IDataReader SelectByUser(Guid userGuid)
 {
     return(DBUserPage.SelectByUser(userGuid));
 }