示例#1
0
        public void GetAdminProfileTest()
        {
            // Arrange
            AdminProfileView admin = new AdminProfileView(1022);
            // Act
            var result = admin.GetAdminProfile();

            // Assert
            Assert.IsNotNull(result);
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
 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));
     }
 }