public ActionResult AddTeamMember(Person person) { if (ModelState.IsValid) { team.TeamMembers.Add(person); Success(string.Format("<b>{0}</b> was successfully added to the database.", person.FirstName), true); return RedirectToAction("/"); } Danger("Looks like something went wrong. Please check your form."); return View(person); }
public ActionResult Index() { var person = new Person { FirstName = "Gunjan", LastName = "Sureja", EmailAddress = "*****@*****.**", BirthDate = new DateTime(1985, 6, 1), Skills = new HashSet<string>() { "Informatica", "Control-M", "Bash", "Perl", "SQL" } }; return View(person); }
static TeamController() { team = new Team(); var person1 = new Person { FirstName = "Gunjan", LastName = "Sureja", EmailAddress = "*****@*****.**", BirthDate = new DateTime(1985, 6, 1), Skills = new HashSet<string>() { "Informatica", "Control-M", "Bash", "Perl", "SQL" }, IsContractor = true }; var person2 = new Person { FirstName = "Uma", LastName = "Shankar", EmailAddress = "*****@*****.**", BirthDate = new DateTime(1960, 6, 1), Skills = new HashSet<string>() { "Tableau", "SQL" }, IsContractor = false }; var person3 = new Person { FirstName = "Mikhail", LastName = "Zyuzin", EmailAddress = "*****@*****.**", BirthDate = new DateTime(1955, 6, 1), Skills = new HashSet<string>() { "Informatica", "SQL", "Java" }, IsContractor = true }; team.TeamMembers.Add(person1); team.TeamMembers.Add(person2); team.TeamMembers.Add(person3); }
public void ArchiveMember(Person person) { throw new NotImplementedException("Not ready for this yet."); }
public ActionResult AddTeamMember() { var person = new Person(); return View(person); }