public ActionResult Details(int id) { var model = _Cardrepo.GetCardDetailsInfo(id); TempData["Card Rule"] = _Cardrepo.GetCardRule(model.CardTypeId); if (model.CardStatusId == 2) { model.CardRule = _Cardrepo.GetCardRule(model.CardTypeId); Htl_AgentCards Agent = _IssueRepo.GetAgentInfoByCardId(id); TempData["AgentName"] = _IssueRepo.GetAgentInfo(Agent.AgentId); TempData["Issue Date"] = Agent.IssueDate; TempData["Card Rule"] = _Cardrepo.GetCardRule(model.CardTypeId); } if (Request.IsAjaxRequest()) { return(PartialView("Details", model)); } return(View(model)); }