private void DoLogout(object sender, EventArgs e) { orderPage = null; productPage = null; masterPage.CurrentUser = new User(); masterPage.OpenChildForm(masterPage.LoginPage, false); ThemeSwitcher.ChangeTheme(masterPage.ActiveForm.Controls, !masterPage.IsLightmode); UpdateHeader(); }
private void OnColorSwitch(object source, EventArgs args) { ThemeSwitcher.ChangeTheme(this.Controls, IsLightmode); if (IsLightmode == true) { IsLightmode = false; } else { IsLightmode = true; } Header.UpdateHeader(); }
private void OpenBestelPage(object sender, EventArgs e) { if (masterPage.CurrentUser.IsLoginValid()) { SoundPlayer Popup2 = new SoundPlayer(Properties.Resources.Popup2); Popup2.Play(); if (orderPage == null) { orderPage = new OrderPage(masterPage); } masterPage.OpenChildForm(orderPage, orderPage.LoginRequired); ThemeSwitcher.ChangeTheme(masterPage.Controls, !masterPage.IsLightmode); UpdateHeader(); } }
public void OpenProductPage(object sender, EventArgs e) { if (masterPage.CurrentUser.IsLoginValid()) { if (productPage == null) { productPage = new ProductPage(masterPage); } masterPage.OpenChildForm(productPage, productPage.LoginRequired); ThemeSwitcher.ChangeTheme(masterPage.Controls, !masterPage.IsLightmode); UpdateHeader(); SoundPlayer Popup2 = new SoundPlayer(Properties.Resources.Popup2); Popup2.Play(); } else { masterPage.LoginPage.SetLoginError("LoginRequired"); } }
private void OnLogInOutButton(object sender, EventArgs e) { if (Logout_btn.Text == "Uitloggen") { SoundPlayer Boo = new SoundPlayer(Properties.Resources.Boo); Boo.Play(); DoLogout(sender, e); ResetAllButtonColors(); } else if (Logout_btn.Text == "Inloggen") { if (masterPage.ActiveForm != masterPage.LoginPage) { masterPage.OpenChildForm(masterPage.LoginPage, masterPage.LoginPage.LoginRequired); ThemeSwitcher.ChangeTheme(masterPage.Controls, !masterPage.IsLightmode); } } else { } UpdateHeader(); }