public ActionResult Index() { ViewBag.homeid = "home"; EventBL _evBl = new EventBL(); RegistrationBL _reg = new RegistrationBL(); RegistrationModel regmodel = new RegistrationModel(); RegistrationModel regmodelCanceled = new RegistrationModel(); List <EventModel> EventList = new List <EventModel>(); if (Convert.ToInt32(Session["ROLE_ID"]) == 1) { if (Session["StarsIdProfile"] != null) { if (!_reg.CheckIsSelectBy(Session["StarsIdProfile"].ToString())) { regmodel = _reg.GetRegistrationByStarsId(Session["StarsIdProfile"].ToString()); } else { return(RedirectToAction("NoAuthorized", "HttpErrors")); } } else { return(RedirectToAction("Welcome", "LBC")); } } else { if (Session["StarsIdProfile"] != null) { regmodel = _reg.GetRegistrationByStarsId(Session["StarsIdProfile"].ToString()); } else { return(RedirectToAction("Welcome", "LBC")); } } ViewBag.lbcCert = regmodel.LBC_CERT; ViewBag.regStatus = regmodel.REGD_STATUS; if (regmodel.EVENT_ID != 0) { ViewBag.eventid = regmodel.EVENT_ID; ViewBag.registered = 1; } else { ViewBag.eventid = 0; ViewBag.registered = 0; } EventList = _evBl.GetAll(Session["StarsIdProfile"].ToString()); return(View(EventList)); }