public IActionResult ConfirmSend() { var CurrentUser = _context.Users.Find(userManager.GetUserId(User)); var SiteOwner = _AdminRequestStore.GetSiteOwner(); var AdminRequestBox = _AdminRequestStore.GetAdminBox(SiteOwner.Id); var RequestUser = new AdminRequestor() { Username = CurrentUser.UserName, UserId = CurrentUser.Id, }; _AdminRequestStore.AddRequestor(RequestUser); var Request = new AdminRequest() { Username = CurrentUser.UserName, RequestDate = DateTime.Now, ApprovalBoxId = AdminRequestBox.Id, AdminRequestorId = RequestUser.Id }; _AdminRequestStore.AddRequest(Request); _context.SaveChanges(); return(RedirectToAction(ActionName.Profile, ControllerName.Accounts)); }
public AdminRequestor AddRequestor(AdminRequestor adminRequestor) { _Context.AdminRequestor.Add(adminRequestor); return(adminRequestor); }