public ActionResult MyEntries( ) { Session["UserName"] = @User.Identity.Name; this._UserName = Session["UserName"] as string ?? ""; if (_UserName == null || _UserName.Equals(String.Empty)) { ViewBag.ErrorMessage = "You must be logged in to continue."; return(RedirectToAction("AwaitingMyApproval", "AwaitingApproval")); } //now resolve the user profile from AD and Xceed StaffADProfile staffADProfile = new StaffADProfile(); staffADProfile.user_logon_name = _UserName; //AD ActiveDirectoryQuery activeDirectoryQuery = new ActiveDirectoryQuery(staffADProfile); staffADProfile = activeDirectoryQuery.GetStaffProfile(); if (staffADProfile == null) { ViewBag.ErrorMessage = "Your profile is not properly setup on the system. Please contact InfoTech."; return(RedirectToAction("AwaitingMyApproval", "AwaitingApproval")); } //Check if the initiator/branch/has an existing entry for the AppraisalPeriod from the Database List <EntriesModel> entryDetails = new List <EntriesModel>(); entryDetails = LINQCalls.getMyPassportWorkflows(staffADProfile); return(View(entryDetails)); }