Example #1
0
        public ActionResult Index()
        {
            int id = Convert.ToInt32(HttpContext.Session["userID"]);

            UserProfileViewModel userProfileViewModel = new UserProfileViewModel();

            User           user;
            List <Project> myProjectsAsOwner;
            List <Project> myProjectsAsWorker;

            user = _userDal.GetUser(id);
            myProjectsAsOwner  = _projectDal.GetByOwnerId(id);
            myProjectsAsWorker = _projectDal.GetByWorkerId(id);

            userProfileViewModel.User = user;
            userProfileViewModel.MyProjectsAsOwner  = myProjectsAsOwner;
            userProfileViewModel.MyProjectsAsWorker = myProjectsAsWorker;

            return(View(userProfileViewModel));
        }
Example #2
0
        public IHttpActionResult GetByOwnerId(int ownerId)
        {
            List <Project> projects = projectDal.GetByOwnerId(ownerId);

            if (projects != null)
            {
                return(Ok(projects));
            }
            else
            {
                return(NotFound());
            }
        }