예제 #1
0
        public static new UserListViewModel ForUserPage(string username, int Page_ID)
        {
            IInfastructureService infastructure = new InfastructureService();
            IProfileService service = new ProfileService();

            var allUsers = new List<User_ProfileInfo>();
            var profiles = service.Profile_GetList();
            foreach (var profile in profiles) {
                var info = new User_ProfileInfo {
                    profile = profile,
                    enemies = service.Profile_GetUserWhoHaveBlocked(profile.username).Count(),
                    friendlies = service.Profile_GetUserWhoHaveFriended(profile.username).Count(),
                    friended = service.Profile_GetFriended(profile.username).Count(),
                    hated = service.Profile_GetBlocked(profile.username).Count()
                };
                allUsers.Add(info);
            }

            return new UserListViewModel {
                allUsers = allUsers,
                navSection = infastructure.PageStructure_GetBySelected(Page_ID),
                avatars = service.Avatar_GetList(),
                profile = service.Profile_GetByUser(username)
            };
        }
예제 #2
0
        public static HomeIndexViewModel ForUserPage(string username, string Url)
        {
            IInfastructureService infastructure = new InfastructureService();

            return new HomeIndexViewModel {
                navSection = infastructure.PageStructure_GetBySelected(32)
            };
        }
예제 #3
0
        public static HomeIndexViewModel ForUserPage(string username, int Page_ID)
        {
            IInfastructureService infastructure = new InfastructureService();
            IPhonebookService provider = new PhonebookService();

            return new HomeIndexViewModel {
                navSection = infastructure.PageStructure_GetBySelected(Page_ID)
            };
        }
예제 #4
0
        public static HomeIndexViewModel ForUserPage(string username, int Page_ID)
        {
            IInfastructureService infastructure = new InfastructureService();
            IDrawingService service = new DrawingService();

            return new HomeIndexViewModel {
                navSection = infastructure.PageStructure_GetBySelected(Page_ID),
                Images = service.Image_GetByUser(username)
            };
        }
예제 #5
0
        public static HomeIndexViewModel ForUserPage(string username, int Page_ID)
        {
            IInfastructureService infastructure = new InfastructureService();
            IPlannerService plannerService = new PlannerService();

            return new HomeIndexViewModel {
                navSection = infastructure.PageStructure_GetBySelected(Page_ID),
                events = plannerService.Event_GetByUser(username)
            };
        }
예제 #6
0
        public static ImageViewModel ForImageUserPage(int Image_ID, string username, int Page_ID)
        {
            IDrawingService service = new DrawingService();
            IInfastructureService infastructure = new InfastructureService();

            return new ImageViewModel {
                navSection = infastructure.PageStructure_GetBySelected(Page_ID),
                image = service.Image_GetTarget(username, Image_ID) ?? new DImage()
            };
        }
예제 #7
0
        public static HomeIndexViewModel ForUserPage(string username, int Page_ID)
        {
            IInfastructureService infastructure = new InfastructureService();
            IProfileService service = new ProfileService();

            return new HomeIndexViewModel {
                navSection = infastructure.PageStructure_GetBySelected(Page_ID),
                avatars = service.Avatar_GetList(),
                profile = service.Profile_GetByUser(username)
            };
        }
예제 #8
0
        public static HomeIndexViewModel ForUserPage(string username, int Page_ID)
        {
            IInfastructureService infastructure = new InfastructureService();
            IMailboxService provider = new MailboxService();
            IProfileService profiler = new ProfileService();

            return new HomeIndexViewModel {
                username = username,
                emails = provider.Email_GetByUser(username),
                blockedUsers = profiler.Blocked_User_GetByUser(username),
                friendedUsers = profiler.Friended_User_GetByUser(username),
                navSection = infastructure.PageStructure_GetBySelected(Page_ID)
            };
        }
        public static new UsersBlockedListView ForUserPage(string username, int Page_ID)
        {
            IInfastructureService infastructure = new InfastructureService();
            IProfileService service = new ProfileService();

            var _base = UserListViewModel.ForUserPage(username, Page_ID);
            var profiles = service.Profile_GetBlocked(username);
            List<User_ProfileInfo> profileInfos = new List<User_ProfileInfo>();

            foreach (var profile in _base.allUsers) {
                if(profiles.Any(x => x.User_Profile_ID == profile.profile.User_Profile_ID)){
                    profileInfos.Add(profile);
                }
            }

            return new UsersBlockedListView {
                allUsers = profileInfos,
                navSection = _base.navSection,
                avatars = _base.avatars,
                profile = _base.profile
            };
        }
예제 #10
0
        static void Main(string[] args)
        {
            Repository.Configuration.connString = "Server=localhost;Database=ApplicationData;Trusted_Connection=True;";
            IInfastructureService service = new InfastructureService();
            DPage Home = new DPage{
                Url = "http://www.jonathan-burrows.com",
                Name = "Home",
                Title = "Main page of JonathanBurrows.com"
            };
            DPage Applications = new DPage {
                Url = "http://www.jonathan-burrows.com/projects",
                Name = "Projects",
                Title = "Newest projects/documentation",
                Parent_Page_ID = 6
            };
            DPage Mailit = new DPage {
                Url = "http://www.jonathan-burrows.com/mailit",
                Name = "Mailit",
                Title = "Email Application",
                Parent_Page_ID = 7
            };
            DPage MailitApplication = new DPage {
                Url = "http://www.jonathan-burrows.com/mailit-application",
                Name = "Application",
                Title = "Use the application",
                Parent_Page_ID = 9
            };
            DPage MailitHome = new DPage{
                Url = "~/",
                Name = "Mailit Home",
                Title = "Portal page of Mailit",
                Parent_Page_ID = 21
            };
            DPage Create = new DPage{
                Url = "~/create",
                Name = "Create",
                Title = "Create a new message",
                Parent_Page_ID = 21
            };
            DPage Inbox = new DPage{
                Url = "~/inbox",
                Name = "Inbox",
                Title = "View all received messages",
                Parent_Page_ID = 21
            };
            DPage Sent = new DPage{
                Url = "~/sent",
                Name = "Sent",
                Title = "View all sent messages",
                Parent_Page_ID = 21
            };
            DPage Friends = new DPage{
                Url = "~/friends",
                Name = "Friends",
                Title = "Manage friends/blocked users.",
                Parent_Page_ID = 21
            };

            service.Page_Create(MailitApplication);

            //service.Page_Create(MailitHome);
            //service.Page_Create(Create);
            //service.Page_Create(Inbox);
            //service.Page_Create(Sent);
            //service.Page_Create(Friends);

            //DPage page = service.Page_FromUrl("Url2");
            //IEnumerable<IEnumerable<DPage>> pages = service.PageStructure_GetBySelected(page.Url);
            //Console.WriteLine(pages.Count());
        }