public ActionResult Add(Guid customerGuid) { if (customerGuid == Guid.Empty) { return(StatusCode(401)); } var contacttype = _customerContactTypeService.GetCustomerContactList(); ContactViewModel contactViewModel = new ContactViewModel(); contactViewModel.ContactTypeSelectListItems = contacttype.ToDictionary(x => x.ContactTypeGuid, x => x.ContactTypeName); contactViewModel.GenderSelectListItems = KeyValueHelper.getGender(); contactViewModel.CustomerGuid = customerGuid; return(PartialView(contactViewModel)); }
public ActionResult Edit(Guid id) { ContactViewModel contactViewModel = new ContactViewModel(); var modeldata = _customerContactService.GetDetailsById(id); contactViewModel = ObjectMapper <CustomerContact, ContactViewModel> .Map(modeldata); var CustomerDetails = _customerService.GetCustomerById(contactViewModel.CustomerGuid); contactViewModel.CustomerName = CustomerDetails.CustomerName; contactViewModel.ContactTypeSelectListItems = _customerContactTypeService.GetCustomerContactList().ToDictionary(x => x.ContactTypeGuid, x => x.ContactTypeName); contactViewModel.GenderSelectListItems = KeyValueHelper.getGender(); return(PartialView(contactViewModel)); }