public void GetAdminProfileTest() { // Arrange AdminProfileView admin = new AdminProfileView(1022); // Act var result = admin.GetAdminProfile(); // Assert Assert.IsNotNull(result); }
public ActionResult EditProfile() { if (Session["userId"] == null) { return(Redirect("~")); } var AdminViewObj = new AdminProfileView((int)Session["userId"]); var Admin = AdminViewObj.GetAdminProfile(); var model = new AdminProfileEditViewModel(); AutoMapper.Mapper.Map(Admin, model); return(View(model)); }
public ActionResult AdminProfile() { if (Session["userId"] == null) { return(Redirect("~")); } var AdminViewObj = new AdminProfileView((int)Session["userId"]); var viewModel = new AdminProfileViewModel { Admin = AdminViewObj.GetAdminProfile() }; return(View(viewModel)); }
public ActionResult AdminUserProfile() { if (Session["userId"] == null) { return(Redirect("~")); } if (TempData["Id"] == null) { return(RedirectToAction("Admins")); } else { var AdminViewObj = new AdminProfileView((int)TempData["Id"]); var viewModel = new AdminProfileViewModel { Admin = AdminViewObj.GetAdminProfile() }; return(View(viewModel)); } }