wait sql init successfully
This commit is contained in:
+35
-18
@@ -47,27 +47,44 @@ namespace SafeBagDE70
|
||||
|
||||
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AppData.Init();
|
||||
|
||||
if (_welcomeUC == null) _welcomeUC = new WelcomeUC();
|
||||
if (_collectionUC == null) _collectionUC = new CollectionUC();
|
||||
if (_informationUC == null) _informationUC = new InformationUC();
|
||||
if (_errorUC == null) _errorUC = new ErrorUC();
|
||||
if (_depositUC == null) _depositUC = new DepositSMUCv2();
|
||||
if (_timeoutUC == null) _timeoutUC = new TimeoutUC();
|
||||
if (_maintainanceUC == null) _maintainanceUC = new MaintainanceUC();
|
||||
if (_endSessionUC == null) _endSessionUC = new EndSessionUC();
|
||||
|
||||
|
||||
gridMain.Children.Add(_welcomeUC);
|
||||
gridMain.Children.Add(_depositUC);
|
||||
gridMain.Children.Add(_collectionUC);
|
||||
gridMain.Children.Add(_informationUC);
|
||||
gridMain.Children.Add(_errorUC);
|
||||
gridMain.Children.Add(_timeoutUC);
|
||||
gridMain.Children.Add(_maintainanceUC);
|
||||
gridMain.Children.Add(_endSessionUC);
|
||||
Task.Run(() =>
|
||||
{
|
||||
AppData.Init();
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
if (AppData.bInitUser)
|
||||
{
|
||||
_welcomeUC.ShowLogin();
|
||||
if (_collectionUC == null) _collectionUC = new CollectionUC();
|
||||
if (_informationUC == null) _informationUC = new InformationUC();
|
||||
if (_errorUC == null) _errorUC = new ErrorUC();
|
||||
if (_depositUC == null) _depositUC = new DepositSMUCv2();
|
||||
if (_timeoutUC == null) _timeoutUC = new TimeoutUC();
|
||||
if (_maintainanceUC == null) _maintainanceUC = new MaintainanceUC();
|
||||
if (_endSessionUC == null) _endSessionUC = new EndSessionUC();
|
||||
|
||||
ShowWelcomeScreen();
|
||||
|
||||
|
||||
gridMain.Children.Add(_depositUC);
|
||||
gridMain.Children.Add(_collectionUC);
|
||||
gridMain.Children.Add(_informationUC);
|
||||
gridMain.Children.Add(_errorUC);
|
||||
gridMain.Children.Add(_timeoutUC);
|
||||
gridMain.Children.Add(_maintainanceUC);
|
||||
gridMain.Children.Add(_endSessionUC);
|
||||
|
||||
ShowWelcomeScreen();
|
||||
}
|
||||
else
|
||||
{
|
||||
_welcomeUC.ShowInfor("KHÔNG TẢI ĐƯỢC DANH SÁCH CỬA HÀNG");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
//ShowDepositScreen();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user