public IActionResult Index()
        {
            PeoplesViewModel peoplesViewModel = new PeoplesViewModel();

            peoplesViewModel.peopleList = _peopleService.All();

            return(View(peoplesViewModel));
        }
Пример #2
0
        //private static List<Person> personList = new List<Person>();

        public IActionResult People()
        {
            PeopleViewModel dataContainer = _peopleService.All();

            //personList = dataContainer.personList;

            return(View(dataContainer));
        }
Пример #3
0
        // GET: CityController/Create
        public ActionResult Create()
        {
            PeopleViewModel     pplVM  = _peopleService.All();
            CreateCityViewModel cityVM = new CreateCityViewModel();

            cityVM.PersonInCity = pplVM.AllPeople;
            return(View(cityVM));
        }
Пример #4
0
        public IActionResult Index()
        {
            /*addPerson.FirstName = "Runar";          // bara för att debugga
             * addPerson.LastName = "Bengtsson";
             * MyService.Add(addPerson);*/

            return(View(MyService.All()));           // (Denna innehåller nu en static lista på alla personer)
        }
        public IActionResult Index()
        {
            ViewData["ShowPersonEditButton"] = true;
            PeopleViewModel peopleViewModel = _service.All();

            peopleViewModel.createPersonViewModel.Cities = _cityService.All().Cities;
            return(View(peopleViewModel));
        }
Пример #6
0
        public IActionResult Add_View_People()
        {
            if (peopleViewModel == null)
            {
                peopleViewModel = ps.All();
            }

            return(View(peopleViewModel));
        }
Пример #7
0
        public IActionResult Index()
        {
            ViewData["ShowPersonEditButton"]   = true;
            ViewData["ShowPersonRemoveButton"] = true;

            PeopleViewModel peopleViewModel = new PeopleViewModel();

            peopleViewModel.MyPersonViewModel = _peopleService.All();

            return(View(peopleViewModel));
        }
Пример #8
0
        public IActionResult DisplayPeople()
        {
            ViewData["ShowPersonEditButton"]   = false;
            ViewData["ShowPersonRemoveButton"] = false;

            List <Person> persons = _peopleService.All().PersonList;

            if (persons.Count != 0)
            {
                return(PartialView("_PeoplePartialView", _peopleService.All().PersonList));
            }

            return(Ok("There is no person in the list"));
        }
Пример #9
0
        // GET: PeopleController
        public ActionResult Index()
        {
            LanguageViewModel languageList = _languageService.All();

            PeopleViewModel personList = _peopleService.All();

            return(View(personList.personList));
        }
Пример #10
0
 public IActionResult DisplayPeople()
 {
     ViewData["ShowPersonDeleteButton"]   = true;
     ViewData["ShowPersonEditButton"]     = false;
     ViewData["ShowPersonDetailsButton"]  = true;
     ViewData["ShowPersonLanguageButton"] = true;
     return(PartialView("_peoplePartialView", _service.All().Persons));
 }
Пример #11
0
        public IEnumerable <Person> Get()
        {
            // Allow calls coming from outside the Host


            PeopleViewModel people    = _peopleService.All();
            var             onePerson = people.personList;

            //string personName = onePerson.Name;
            //onePerson[0].Country = null;
            return(onePerson);
        }
        public ActionResult AddLanguageToPerson()
        {
            PersonLanguageViewModel personLanguageViewModel = new PersonLanguageViewModel();
            //PeopleViewModel peopleViewModel = new PeopleViewModel();

            var resultPeopleViewModel = _peopleService.All();

            personLanguageViewModel.PeopleList   = resultPeopleViewModel.PersonList;
            personLanguageViewModel.LanguageList = _languageService.All();

            return(View(personLanguageViewModel));
        }
Пример #13
0
        public IActionResult Index()                                    // Index page, this is the first page shown
        {
            // Only for demonstation purpose
            List <Person> indexPersonList = _peopleService.All().PersonList; // Only the personlist is needed
            Person        lastPerson      = null;                            // Null by default

            if (indexPersonList.Count > 0)                                   // Must be one person in the list
            {
                lastPerson = indexPersonList[indexPersonList.Count - 1];     // The last (newest) person in the list
            }                                                                // End of demonstration purpose

            return(View(lastPerson));                                        // Last person is returned to Home Index
        }
        public IActionResult AjaxFindByCityOrName(string filter)
        {
            PeopleViewModel peopleViewModel = new PeopleViewModel();

            peopleViewModel.Search = filter;


            if (peopleViewModel.Search == null)
            {
                var allPeople = _peopleService.All();

                //Response.StatusCode = 400;

                return(PartialView("_ListPersonPartialView", allPeople));
            }
            else
            {
                var newSearch = _peopleService.FindBy(peopleViewModel);
                return(PartialView("_ListPersonPartialView", newSearch));
            }
        }
Пример #15
0
 public List <Person> Get()
 {
     //Response.StatusCode = 418;//Im a Tea Pot
     return(_peopleService.All().PersonList);         // Take out the PersonList itself
 }
 public IActionResult AjaxShowAll()
 {
     return(PartialView("_PeoplePatialView", _peopleService.All().PeopleList));
 }
 public IActionResult Index()
 {
     return(View(_peopleService.All()));
 }
        public IActionResult Index()
        {
            var result = _peopleService.All();

            return(View(result));
        }
Пример #19
0
 public IActionResult GetAll()
 {
     return(PartialView("_AjaxPeopleListPartialView", _peopleService.All().PeopleList));
 }
Пример #20
0
 [HttpGet]                                                       // The method will only respond to the get request
 public IActionResult Index()                                    // Normally shows all persons available here
 {
     return(View(_peopleService.All()));                         // Returns the created ViewResult for the response
 }
Пример #21
0
        public IActionResult AllPersonsPartialView()
        {
            List <Person> personList = _peopleService.All().PersonList;  // .All() gets the ViewModel, set up the data for the viewmodel

            return(PartialView("_AllPersonPartialView", personList));    // Return and send it as a partial view
        }