protected void Page_Load(object sender, EventArgs e) { if (Session["LoggedIn"] != null) { UsersDb usersDb = new UsersDb(); Users user = usersDb.GetUserById(Convert.ToInt32(Session["LoggedIn"])); currentUser = user; } else { Response.Redirect("~/Login.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["LoggedIn"] != null) { UsersDb usersDb = new UsersDb(); Users user = usersDb.GetUserById(Convert.ToInt32(Session["LoggedIn"])); currentUser = user; userName.InnerText = $"{user.FirstName} {user.LastName}"; birthday.InnerText = $"Birthday:{user.Birthday.ToString("MM/dd/yyyy")}"; } else { Response.Redirect("~/Login.aspx"); } GetAccount(); GetPurchases(); GetBudget(); ConvertToJson(); }