Пример #1
0
        public void GetAssistantProfileTest()
        {
            // Arrange
            AssistantProfileView assistant = new AssistantProfileView(1023);

            // Act
            var result = assistant.GetAssistantProfile();

            // Assert
            Assert.IsNotNull(result);
        }
Пример #2
0
        public ActionResult EditProfile()
        {
            if (Session["userId"] == null)
            {
                return(Redirect("~"));
            }
            var AssistantViewObj = new AssistantProfileView((int)Session["userId"]);
            var Assistant        = AssistantViewObj.GetAssistantProfile();
            var model            = new AssistantProfileEditViewModel();

            AutoMapper.Mapper.Map(Assistant, model);
            return(View(model));
        }
Пример #3
0
        public ActionResult AssistantUserProfileEdit(int id)
        {
            if (Session["userId"] == null)
            {
                return(Redirect("~"));
            }
            var   AssistantViewObj = new AssistantProfileView(id);
            Users user             = AssistantViewObj.GetAssistantProfile();
            AssistantProfileEditViewModel model = new AssistantProfileEditViewModel();

            AutoMapper.Mapper.Map(user, model);
            return(View(model));
        }
Пример #4
0
        public ActionResult AssistantProfile()
        {
            if (Session["userId"] == null)
            {
                return(Redirect("~"));
            }
            var AssistantViewObj = new AssistantProfileView((int)Session["userId"]);
            var viewModel        = new AssistantProfileViewModel
            {
                Assistant = AssistantViewObj.GetAssistantProfile()
            };

            return(View(viewModel));
        }
Пример #5
0
 public ActionResult AssistantUserProfile()
 {
     if (Session["userId"] == null)
     {
         return(Redirect("~"));
     }
     if (TempData["Id"] == null)
     {
         return(RedirectToAction("Assistants"));
     }
     else
     {
         var AssistantViewObj = new AssistantProfileView((int)TempData["Id"]);
         var viewModel        = new AssistantProfileViewModel
         {
             Assistant = AssistantViewObj.GetAssistantProfile()
         };
         return(View(viewModel));
     }
 }