Пример #1
0
        public ActionResult Index()
        {
            PeopleVM vm = new PeopleVM();

            vm.People = PersonDb.GetPeople();
            if (TempData.ContainsKey("Person"))
            {
                Person p = (Person)TempData["Person"];
                vm.Message = p.FirstName + " " + p.LastName + " added!";
            }

            return(View(vm));
        }
Пример #2
0
 public ActionResult Add(Person p)
 {
     PersonDb.Add(p);
     TempData["Person"] = p;
     return(Redirect("/people/index"));
 }