public ActionResult PremiumPaymentHistory(string month) { ProfileBusiness pb = new ProfileBusiness(); if (User.IsInRole("Policy Holder")) { if (!String.IsNullOrEmpty(month)) { if (pb.getPaymentByMonth(HttpContext.User.Identity.Name, month) != null) { PersonalPaymentHistory found = pb.getPaymentByMonth(HttpContext.User.Identity.Name, month); var toList = new List <PersonalPaymentHistory>(); toList.Add(found); return(View(toList)); } else { TempData["Error"] = "No Premium payments were found under " + month; return(View(new List <PersonalPaymentHistory>())); } } return(View(pb.getPaymentHistory(HttpContext.User.Identity.Name))); } TempData["Error"] = "You are not recognized as a Policy Holder, Therefore some content was hiden for privacy"; return(View(new List <PersonalPaymentHistory>())); }