Esempio n. 1
0
        public ActionResult AddPerson(Person person)
        {
            var repository = new PeopleRepository(Properties.Settings.Default.ConStr);

            repository.AddPerson(person);
            TempData["message"] = "New person added, id: " + person.Id;
            return(Redirect("/home/index"));
        }
 public async Task <string> CreatePerson([FromForm] MyPerson person)
 {
     _logger.LogTrace("Action: CreatePerson");
     if (await _azurePersonGroupRepository.CreatePersonFromForm(person) == "Person added")
     {
         _peopleRepository.AddPerson(person);
     }
     return("Person added");
 }
Esempio n. 3
0
        public void WelcomeTextIsDisplayed()
        {
            var c             = new Person("FirstName", "LastName", 50);
            var dataStoreMock = new Mock <IDataStore>();
            var peopleRepo    = new PeopleRepository(dataStoreMock.Object);

            var result = peopleRepo.AddPerson(c);

            Assert.IsTrue(result);
        }
Esempio n. 4
0
        public IActionResult Create(Contact contact)
        {
            if (!ModelState.IsValid)
            {
                return(View(contact));
            }

            repository.AddPerson(contact);
            return(RedirectToAction(nameof(Index)));
        }
        public void AddRandomPerson(RandomPersonViewModel randomPersonViewModel)
        {
            PeopleRepository repo = new PeopleRepository(_connectionString);

            for (int i = 1; i <= randomPersonViewModel.Number; i++)
            {
                Person p = repo.CreateRandomPerson(randomPersonViewModel.MinAge, randomPersonViewModel.MaxAge);
                repo.AddPerson(p);
            }
        }
        public void AddPerson(DateVM vm)
        {
            var repo = new PeopleRepository(_connection);

            repo.AddPerson(vm.Date);
        }
        public void AddPerson(Person personToAdd)
        {
            PeopleRepository repos = new PeopleRepository(_connectionString);

            repos.AddPerson(personToAdd);
        }
        public Person AddPerson(Person person)
        {
            var repo = new PeopleRepository(_connectionString);

            return(repo.AddPerson(person));
        }
        public void AddPerson(Person person)
        {
            var repo = new PeopleRepository(_connectionString);

            repo.AddPerson(person);
        }
        public void AddPerson(Person person)
        {
            var db = new PeopleRepository(_conn);

            db.AddPerson(person);
        }
Esempio n. 11
0
        public void AddPerson(Person p)
        {
            PeopleRepository pr = new PeopleRepository(_connectionString);

            pr.AddPerson(p);
        }
Esempio n. 12
0
        public void AddPerson(Person p)
        {
            var repos = new PeopleRepository(_connectionString);

            repos.AddPerson(p);
        }