示例#1
0
        public MainWindow()
        {
            InitializeComponent();
            MostrarSplashScreen();

            sqliteConnection = new SQLiteConnection("Data Source=.\\dados\\DadosAgua.db; Version=3;");
            sqliteConnection.Open();

            SQLiteCommand    cmd = new SQLiteCommand("Select * from DadosAgua", sqliteConnection);
            SQLiteDataReader da  = cmd.ExecuteReader();

            while (da.Read())
            {
                textContador.Text = da.GetValue(3).ToString();
                contador          = Convert.ToInt32(da.GetValue(3));
                copoml            = Convert.ToInt32(da.GetValue(1));
                totalml           = Convert.ToInt32(da.GetValue(2));
                carinha.Source    = (ImageSource)Resources[da.GetValue(4)];
            }

            sqliteConnection.Close();


            if (copoml == 0 && totalml == 0)
            {
                MessageBox.Show("Defina as Configurações Primeiro!!!", "BebaAguaAPP", MessageBoxButton.OK, MessageBoxImage.Information);
                ConfigWindow w2 = new ConfigWindow();
                w2.ShowDialog();
            }

            this.ShowInTaskbar = true;
            this.Left          = SystemParameters.PrimaryScreenWidth - this.Width - PADDING;
            System.Windows.Threading.DispatcherTimer DispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            DispatcherTimer.Tick    += DispatcherTimer_Tick;
            DispatcherTimer.Interval = new TimeSpan(0, 0, 3600);
            DispatcherTimer.Start();
        }
示例#2
0
        private void ConfigWindowAbrir(object sender, RoutedEventArgs e)
        {
            ConfigWindow w2 = new ConfigWindow();

            w2.ShowDialog();
        }