Beispiel #1
0
        public UserBuildingViewModel GetViewModel(string userName)
        {
            UserBuildingViewModel userBuildingViewModel = new UserBuildingViewModel();

            userBuildingViewModel.UserBuildings = context.GetUserBuildings(userName);

            return(userBuildingViewModel);
        }
Beispiel #2
0
        public UserBuildingViewModel GetViewModel()
        {
            List <User> users = context.GetUsers();
            string      userName;

            if (users.Count > 0)
            {
                userName = users[0].UserName;
            }
            else
            {
                userName = "";
            }
            UserBuildingViewModel userBuildingViewModel = new UserBuildingViewModel();

            userBuildingViewModel.Users         = users;
            userBuildingViewModel.UserBuildings = context.GetUserBuildings(userName);

            return(userBuildingViewModel);
        }