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

            userBuildingViewModel.UserBuildings = context.GetUserBuildings(userName);

            return(userBuildingViewModel);
        }
예제 #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);
        }