// метод, переход в окно авторизации private void Login() { ActiveForm.Hide(); Login_Window login_Window = new Login_Window(); login_Window.ShowDialog(); Close(); }
public MainWindow() { CustomMapper Mapper = new CustomMapper(); _loginWindow = new Login_Window(); _homeMenu = new Home_Menu(); _reportMenu = new Reports_Menu(); _settingView = new Setting_View(); InitializeComponent(); Init(); CheckSession(); }
private void CheckSession() { BaseController.CurrentUser = null; this.Hide(); _loginWindow = new Login_Window(); if (_loginWindow.ShowDialog() == true) { this.Show(); } else { Close(); System.Environment.Exit(0); } }
void App_Startup(object sender, StartupEventArgs e) { try { SQLite_Entity.Connect(); ////language codes operating system windows CultureInfo ci = CultureInfo.CurrentCulture; try { var data_lang = SQLite_Entity.Connection.Table <DataBase.SettingsTable>().FirstOrDefault(); if (data_lang != null) { if (data_lang.Lang_Resources != "") { if (data_lang.Lang_Resources == "ar" || data_lang.Lang_Resources == "Arabic" || data_lang.Lang_Resources == "ar-AR") { Settings.FlowDirection_RightToLeft = true; } LocalResources.Culture = new System.Globalization.CultureInfo(data_lang.Lang_Resources); System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(data_lang.Lang_Resources); System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(data_lang.Lang_Resources); } } else { //language codes operating system windows var Lang_OS_windows2 = Settings.Lang_Resources; var Name_LocalResources = @"pack://*****:*****@"\Locales"; Cef.Initialize(cefSettings); if (user != null) { if (user.Status == "Active") { WoWonderClient.Current.AccessToken = user.Session; UserDetails.User_id = user.UserId; // INSERT DATA PROFILE USER TO LIST SQLiteCommandSender.Select_From_ProfileTable_By_ID(user.UserId); SQLiteCommandSender.GetUsersSettings(); var client = new Client(Settings.TripleDesAppServiceProvider); //var first_rofile = MemoryVariables.UsersProfileList.First(); MainWindow wn = new MainWindow(); wn.Show(); } else if (user.Status == "Pending") { WoWonderClient.Current.AccessToken = user.Session; UserDetails.User_id = user.UserId; MainWindow wn = new MainWindow(); wn.Show(); } } else { Login_Window fff = new Login_Window(); fff.Show(); } } catch (Exception exception) { MessageBox.Show(exception.Message); Console.WriteLine(exception); } }