예제 #1
0
        public ActionResult Index()
        {
            int            UserAccountId = 0;
            int            employeeId    = 0;
            Review_Details reviewDetail;

            if (Session["AccountId"] != null)
            {
                UserAccountId = (int)Session["AccountId"];
                employeeId    = reviewDetailsBL.GetEmployeeIdByAccountId(UserAccountId);
                reviewDetail  = reviewDetailsBL.CheckExists(employeeId);
                List <Review_Details> review = reviewDetailsBL.DisplayReviewDetails().ToList();

                if (reviewDetail == null)
                {
                    return(RedirectToAction("NoSchedule", "ReviewSchedule"));
                }
                else
                {
                    //if (employeeId.ToString() == reviewDetail.Revieweename && employeeId.ToString() == reviewDetail.Reviewername)
                    //{
                    //    //TempData["Ih"] = reviewDetailsBL.DisplayReview(employeeId);
                    //    return RedirectToAction("DisplayReviewerDetails");
                    //}
                    //else
                    //{
                    //   // TempData["Ih"] = reviewDetailsBL.DisplayReview(employeeId);
                    //    return RedirectToAction("DisplayRevieweeDetails");
                    //}

                    int count = 0;
                    count = reviewDetailsBL.DisplayReviews(employeeId);
                    if (count == 10)
                    {
                        TempData["Ih"] = reviewDetailsBL.DisplayReviewerReview(employeeId);
                        return(RedirectToAction("DisplayReviewerDetails"));
                    }
                    else if (count == 5)
                    {
                        TempData["Ih"] = reviewDetailsBL.DisplayRevieweeReview(employeeId);
                        return(RedirectToAction("DisplayRevieweeDetails"));
                    }
                    else
                    {
                        TempData["Ih"] = reviewDetailsBL.DisplayRevieweeReview(employeeId);
                        TempData["Id"] = reviewDetailsBL.DisplayReviewerReview(employeeId);
                        return(RedirectToAction("DisplayBothDetails"));
                    }
                }
            }
            return(View());
        }
 public ActionResult DisplayReviewDetails()
 {
     TempData["Employees"] = reviewDetailsBL.DisplayReviewDetails();
     return(View());
 }