コード例 #1
0
 public ActionResult AddContactInfoForPerson(ContactTypeForPersonViewModel contactTypeForPersonViewModel)
 {
     if (ModelState.IsValid)
     {
         contactTypeForPersonViewModel.PersonContactInfo.PersonPrimaryInfoID = contactTypeForPersonViewModel.PersonPrimaryInfo.PersonPrimaryInfoID;
         unitOfWork.PersonContactInfoRepository.Insert(contactTypeForPersonViewModel.PersonContactInfo);
         unitOfWork.Save();
         return RedirectToAction("Index");
     }   
     return View(SetupForAddContactInfoForPerson(contactTypeForPersonViewModel, contactTypeForPersonViewModel.PersonPrimaryInfo.PersonPrimaryInfoID));
 }
コード例 #2
0
 public ActionResult EditContactInfoForPerson(int personPrimaryInfoID, int personContactTypeID)
 {
     ContactTypeForPersonViewModel contactTypeForPersonViewModel = new ContactTypeForPersonViewModel();
     contactTypeForPersonViewModel.PersonContactInfo = unitOfWork.PersonContactInfoRepository.GetByID(personPrimaryInfoID, personContactTypeID);
     return View(SetupForAddContactInfoForPerson(contactTypeForPersonViewModel, personPrimaryInfoID));
 }
コード例 #3
0
 public ActionResult AddContactInfoForPerson(int personPrimaryInfoID)
 {
     ContactTypeForPersonViewModel contactTypeForPersonViewModel = new ContactTypeForPersonViewModel();
     contactTypeForPersonViewModel.PersonContactInfo = new PersonContactInfo();
     return View(SetupForAddContactInfoForPerson(contactTypeForPersonViewModel, personPrimaryInfoID));
 }
コード例 #4
0
 private ContactTypeForPersonViewModel SetupForAddContactInfoForPerson(ContactTypeForPersonViewModel contactTypeForPersonViewModel, int personPrimaryInfoID)
 {
     contactTypeForPersonViewModel.PersonPrimaryInfo = unitOfWork.PersonPrimaryInfoRepository.GetByID(personPrimaryInfoID);
     contactTypeForPersonViewModel.PersonContactTypeSelectList = unitOfWork.PersonContactTypeRepository.PersonContactTypeSelectList();
     return contactTypeForPersonViewModel;
 }