Ejemplo n.º 1
0
        public async Task <IActionResult> About()
        {
            ViewData["Message"] = "Your application description page.";
            PrivatePageModel privatePage = await _apiCaller.CallApi <PrivatePageModel>("", Helpers.HttpMethodType.GET, "OwnPage");

            return(View(privatePage));
        }
Ejemplo n.º 2
0
        public PrivatePageModel GetOwnPage(string userIdentificator)
        {
            var page = new PrivatePageModel
            {
                Person = new PersonModel {
                    FirstName = "Jan", LastName = "Kowalski", Picture = "/images/ludziki.jpg"
                },
                Friends = new FriendsModel
                {
                    Peoples = new List <SimpleProfileModel>
                    {
                        new SimpleProfileModel {
                            Person = new PersonModel {
                                FirstName = "Edward", LastName = "Nowak", Picture = "/images/ludziki.jpg"
                            },
                            Photo = new PhotoModel()
                        },
                        new SimpleProfileModel {
                            Person = new PersonModel {
                                FirstName = "Paweł", LastName = "Janusz", Picture = "/images/ludziki.jpg"
                            },
                            Photo = new PhotoModel()
                        }
                    }
                },
                PhotosGallery = new PhotoGalleryModel
                {
                    PhotosPath = new List <PhotoModel>
                    {
                        new PhotoModel {
                            Path = "/images/ludziki.jpg"
                        },
                        new PhotoModel {
                            Path = "/images/ludziki.jpg"
                        },
                        new PhotoModel {
                            Path = "/images/ludziki.jpg"
                        }
                    }
                },
                ContextWall = new ContextWallModel
                {
                    Posts = new List <PostModel>
                    {
                        new PostModel {
                            Header = "Nagłówek 1", Body = "Piszę o świecie"
                        },
                        new PostModel {
                            Header = "Nagłówek 2", Body = "Piszę o Marsie"
                        }
                    }
                }
            };

            return(page);
        }
Ejemplo n.º 3
0
        public PrivatePageModel GetOwnPage(string userIdentificator)
        {
            var model = new PrivatePageModel();;

            var person = base._unitOfWork.UserRepository.Find(x => x.UserIdentificator == userIdentificator);

            if (person == null)
            {
                return(null);
            }
            model.Person = new PersonModel
            {
                UserIdentificator = userIdentificator,
                FirstName         = person.FirstName,
                LastName          = person.LastName,
                Birthdate         = person.Birthdate,
                Gender            = person.Gender,
                JoinDate          = person.JoinDate,
                Mail = person.Mail
            };

            return(model);
        }