public IActionResult Index() { // TODO: Dùng tạm do chưa có chức năng login if (HttpContext.Session is null || String.IsNullOrEmpty(HttpContext.Session.GetString(Constants.ID_FACEBOOK))) { return(SesionHelper.CheckLogin()); } ViewBag.Session = HttpContext.Session.GetString(Constants.MENU_ACTIVE); ViewBag.Role = HttpContext.Session.GetString(Constants.ROLE); ViewBag.NameFacebook = HttpContext.Session.GetString(Constants.NAME_FACEBOOK); return(View()); }
public IActionResult Index() { // TODO: Dùng tạm do chưa có chức năng login if (HttpContext.Session is null || String.IsNullOrEmpty(HttpContext.Session.GetString(Constants.ID_FACEBOOK))) { return(SesionHelper.CheckLogin()); } var your_id_fb = HttpContext.Session.GetString(Constants.ID_FACEBOOK); ViewBag.Session = HttpContext.Session.GetString(Constants.MENU_ACTIVE); ViewBag.Role = HttpContext.Session.GetString(Constants.ROLE); ViewBag.IdFacebook = your_id_fb; ViewBag.NameFacebook = HttpContext.Session.GetString(Constants.NAME_FACEBOOK); var data = _queryBuilder.Query(ConstantsDatabase.TABLE_USERS) .Where(ConstantsDatabase.USERS_ID_FACEBOOK, your_id_fb) .FirstOrDefault <user>(); return(View(data == null ? new user() : data)); }