Esempio n. 1
0
        public ActionResult AppraisalProfile(int? id)
        {
            // retrieve profile by appraisal
            Web.Models.DTO.AppraisalProfilePage appraisalProfilePageDTO = new Models.DTO.AppraisalProfilePage()
            {
                User = CurrentUser
            };

            if (id.HasValue)
            {
                appraisalProfilePageDTO.Appraisal = PMS.Model.PMSModel.GetAppraisalById(Convert.ToInt32(id));

                if (appraisalProfilePageDTO.Appraisal != null)
                {
                    if (!CheckAccessRights(appraisalProfilePageDTO.Appraisal))
                    {
                        TempData["AlertMessage"] = Resources.Resource.MSG_APPRAISAL_NO_ACCESS;
                        return Redirect(Url.Content("~/Home/Index"));
                    }
                    else
                    {
                        ViewData.Model = appraisalProfilePageDTO;
                        return View();
                    }
                }
                else
                {
                    TempData["AlertMessage"] = Resources.Resource.MSG_NO_APPRAISAL_FOUND;
                    return Redirect(Url.Content("~/Home/Index"));
                }

            }
            else
            {
                TempData["AlertMessage"] = "Unable to retrieve appraisal profile.";
                return Redirect(Url.Content("~/"));
            }
        }
Esempio n. 2
0
        public ActionResult AppraisalProfile(int?id)
        {
            // retrieve profile by appraisal
            Web.Models.DTO.AppraisalProfilePage appraisalProfilePageDTO = new Models.DTO.AppraisalProfilePage()
            {
                User = CurrentUser
            };

            if (id.HasValue)
            {
                appraisalProfilePageDTO.Appraisal = PMS.Model.PMSModel.GetAppraisalById(Convert.ToInt32(id));

                if (appraisalProfilePageDTO.Appraisal != null)
                {
                    if (!CheckAccessRights(appraisalProfilePageDTO.Appraisal))
                    {
                        TempData["AlertMessage"] = Resources.Resource.MSG_APPRAISAL_NO_ACCESS;
                        return(Redirect(Url.Content("~/Home/Index")));
                    }
                    else
                    {
                        ViewData.Model = appraisalProfilePageDTO;
                        return(View());
                    }
                }
                else
                {
                    TempData["AlertMessage"] = Resources.Resource.MSG_NO_APPRAISAL_FOUND;
                    return(Redirect(Url.Content("~/Home/Index")));
                }
            }
            else
            {
                TempData["AlertMessage"] = "Unable to retrieve appraisal profile.";
                return(Redirect(Url.Content("~/")));
            }
        }