// GET: Home public ActionResult Index() { // Initialize our custom session. Helpers.Session s = new Helpers.Session(User.Identity); // Pass in the current appraisalId because we shouldn't be using this app outside of the February - July window. Helpers.Session.Current.CurrentAppraisalId = entities.Appraisals.Where(aa => aa.ReviewYear == DateTime.Now.Year).FirstOrDefault().AppraisalId; // If the current user is an Associate, forward them on to the IdentifyPartners page if (Helpers.UserType.UserTypes.Associate.ToString() == Helpers.Session.Current.UserType) return RedirectToAction("IdentifyPartners", "Home", new { employeeId = AssociateAppraisals.Helpers.Session.Current.EmployeeId, appraisalId = AssociateAppraisals.Helpers.Session.Current.CurrentAppraisalId }); IEnumerable<Appraisal> appraisals = entities.Appraisals.ToList(); return View(appraisals); }
// GET: Home public ActionResult Index() { // Initialize our custom session. Helpers.Session s = new Helpers.Session(User.Identity); // Pass in the current appraisalId because we shouldn't be using this app outside of the February - July window. Helpers.Session.Current.CurrentAppraisalId = entities.Appraisals.Where(aa => aa.ReviewYear == DateTime.Now.Year).FirstOrDefault().AppraisalId; // If the current user is an Associate, forward them on to the IdentifyPartners page if (Helpers.UserType.UserTypes.Associate.ToString() == Helpers.Session.Current.UserType) { return(RedirectToAction("IdentifyPartners", "Home", new { employeeId = AssociateAppraisals.Helpers.Session.Current.EmployeeId, appraisalId = AssociateAppraisals.Helpers.Session.Current.CurrentAppraisalId })); } IEnumerable <Appraisal> appraisals = entities.Appraisals.ToList(); return(View(appraisals)); }