public IActionResult Add(AddNewOrganizationViewModel addNewOrganizationViewModel) { try { if (ModelState.IsValid) { Organization newOrganization = new Organization { ContactName = addNewOrganizationViewModel.ContactName, NameofOrganization = addNewOrganizationViewModel.NameofOrganization, StreetAddressOfOrganization = addNewOrganizationViewModel.StreetAddressOfOrganization, ZipCode = addNewOrganizationViewModel.ZipCode, City = addNewOrganizationViewModel.City, State = addNewOrganizationViewModel.State, Country = addNewOrganizationViewModel.Country, Phone = addNewOrganizationViewModel.Phone }; return(Redirect("/Home")); } } catch { return(View("/Add")); } // { // Console.WriteLine("Please complete form" ); // } return(Redirect("/Home")); }
public IActionResult Add() { AddNewOrganizationViewModel addOrganization = new AddNewOrganizationViewModel(); return(View(addOrganization)); }