Esempio n. 1
0
        /// <summary>
        /// Inicia ou atualiza o contexto de dados do Entity Framework
        /// </summary>
        private void RefreshEFContext()
        {
            EFContext = new AlphaEntities();
            EFHelper.ChangeDatabase(EFContext, "Alpha", mainWindowContext.settings.SqlInstance, "sa", "sic742", true, "AlphaEntities");
            var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            var connectionStringsSection = (ConnectionStringsSection)config.GetSection("connectionStrings");

            Console.WriteLine(connectionStringsSection.ConnectionStrings["AlphaEntities"].ConnectionString);
        }
        /// <summary>
        /// Inicializa componentes da classe.
        /// </summary>
        private void InitializeComponents()
        {
            GetMainWindow();
            settings  = JsonHelper.JsonFileReader(@"\AlphaSettings.json");
            EFContext = new AlphaEntities();
            EFHelper.ChangeDatabase(EFContext, "Alpha", settings.SqlInstance, "sa", "sic742", true, "AlphaEntities");
            CenterWindowOnScreen();

            #region Inicialização dos comandos

            registerMenuCommand        = new RelayCommand(ShowOrHideSubRegisterSubMenu);
            showProvidersWindowCommand = new RelayCommand(ShowProviderWindow);
            showProductsWindowCommand  = new RelayCommand(ShowProductWindow);
            maxProductWindowCommand    = new RelayCommand(MaxProductWindow);
            maxProviderWindowCommand   = new RelayCommand(MaxProviderWindow);
            signOutCommand             = new RelayCommand(SignOut);
            #endregion
        }
 /// <summary>
 /// Inicia ou atualiza o contexto de dados do Entity Framework.
 /// </summary>
 private void RefreshEFContext()
 {
     EFContext = new AlphaEntities();
     EFHelper.ChangeDatabase(EFContext, "Alpha", mainWindowContext.settings.SqlInstance, "sa", "sic742", true, "AlphaEntities");
 }