// GET: PublisherController/Edit/5 public async Task <ActionResult> EditPublisherAsync(int id) { //Use get congregation info from DB var publisherInfo = await _userManager.FindByIdAsync(id.ToString()); //Use the created map var viewModel = _mapper.Map <PublisherViewModel>(publisherInfo); return(View(viewModel)); }
// GET: CongregationPortalController public async Task <ActionResult> IndexAsync() { //Passed Data from login var passedUserInfo = HttpContext.Session.GetObjectFromJson <LoginPassedDataViewModel>("userCredentials"); //Congregation Information is hardcoded int CongregationID = passedUserInfo.CongregationId; var congregation = await _congregation.GetByIdAsync(CongregationID); //User Information is hardcoded string userID = passedUserInfo.Id.ToString(); var userinfo = await _userManager.FindByIdAsync(userID); var ViewModel = new CongregationPortalViewModel() { Id = passedUserInfo.Id, CongregationId = CongregationID, CongregationName = congregation.CongregationName, PublisherFirstName = userinfo.PublisherFirstName, PublisherLastName = userinfo.PublisherLastName }; return(View(ViewModel)); }