Esempio n. 1
0
        /// <summary>
        /// Méthode à éxécuter pour initialiser le controleur
        /// </summary>
        /// <returns></returns>
        private async Task InitializeAsync()
        {
            Bdd = await ComSqlite.GetComSqlite();

            if (Random == null)
            {
                Random = new Random();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                DebugSettings.EnableFrameRateCounter = true;
            }
#endif
            var rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;
                rootFrame.Navigated        += OnNavigated;
                Window.Current.Content      = rootFrame;
            }

            SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                rootFrame.CanGoBack ?
                AppViewBackButtonVisibility.Visible :
                AppViewBackButtonVisibility.Collapsed;

            if (rootFrame.Content == null)
            {
                //Controle de l'éxistence de la base de donnée pour choisir quel mode de démarrage
                var sqlite = await ComSqlite.GetComSqlite();

                var dbExist = await sqlite.CheckDbExist();

                //Génération des données Utils
                DeviseUtils.GeneratePays();
                DeviseUtils.GenerateDevise();

                if (dbExist)
                {
                    OpenShell();
                }
                else
                {
                    OpenDemarrageView();
                }
            }
            Window.Current.Activate();
        }
Esempio n. 3
0
        /// <summary>
        /// Charger les données liées au roaming
        /// </summary>
        /// <returns>la task</returns>
        private static async Task DemarrageRoaming()
        {
            if (_roamingCompte == null)
            {
                _roamingCompte = new RoamingCompteModel();
            }

            if (_roamingCompteFile == null)
            {
                _roamingCompteFile = new ComFile(ContexteStatic.FichierCompteRoaming, ComFile.PlaceEcriture.Roaming);

                var sqlite = await ComSqlite.GetComSqlite();

                var dbExist = await sqlite.CheckDbExist();

                //controle du fichier (si il est vide et que la base de donnée (si elle existe) contient des données, on syncrhonise)
                if ((!await _roamingCompteFile.FileExist() || (await _roamingCompteFile.FileExist() && await _roamingCompteFile.GetSizeFile() == 0)) &&
                    App.ModeApp == AppareilEnum.ModeAppareilPrincipal &&
                    dbExist)
                {
                    var business = new BanqueBusiness();
                    await business.Initialization;
                    var listeBanque = await business.GetBanques();

                    foreach (var banque in listeBanque)
                    {
                        await AjouterBanque(banque);

                        var listeCompte = await business.GetCompteFmBanque(banque.Id);

                        foreach (var compte in listeCompte)
                        {
                            await AjouterCompte(compte);
                        }
                    }
                }
            }

            await LoadFileCompte();
        }
Esempio n. 4
0
 /// <summary>
 /// Méthode à éxécuter pour initialiser le controleur
 /// </summary>
 /// <returns></returns>
 private async Task InitializeAsync()
 {
     Bdd = await ComSqlite.GetComSqlite();
 }