public ActionResult Details(long id) { if (id != 0) { //Already Exist PlayersRepository modelRepo = new PlayersRepository(); var model = modelRepo.ReadOne(id); //Create Player Premium Dashboard view bag only if Admin user is Logged in PlayerDashboardRepository pdRepo = new PlayerDashboardRepository(); ViewBag.PlayerPremiumDashboard = pdRepo.ReadOne(model.PlayerID); if (Request.QueryString["m"] != null) { List <MessagesExt> ListOfMsgs = new List <MessagesExt>(); new MessagesRepository().BuildMessageList(SecurityUtils.DecryptCypher(Request.QueryString["m"].ToString()), TypeOfMessage.Success, ref ListOfMsgs); model.ListOfMsgs.AddRange(ListOfMsgs); } BindViewBags(ref model); return(View(model)); } else { //For New Customer Record var model = new PlayersExt(); model.PlayerID = 0; BindViewBags(ref model); return(View(model)); } }