Exemplo n.º 1
0
        private void doGetDailySumProduction()
        {
            using (ProviderMsAccess prov = new ProviderMsAccess(@"C:\Users\Szymon\Documents\baza.accdb"))
            {
                FroniusSymoLog log = new FroniusSymoLog();

                DateTime beginDate = prov.GetFroniusProductionBeginDate();

                progressBar1.Invoke((MethodInvoker) delegate
                {
                    progressBar1.Maximum = (DateTime.Now.Date - beginDate.AddDays(1)).Days;
                });


                for (beginDate = beginDate.AddDays(1); beginDate < DateTime.Now.Date; beginDate = beginDate.AddDays(1))
                {
                    double dailyProduction = log.DailySumProduction(beginDate);
                    prov.DailySumProduction(beginDate, dailyProduction);
                    progressBar1.Invoke((MethodInvoker) delegate
                    {
                        progressBar1.Increment(1);
                    });
                }
            }
        }
Exemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            string sDirectoryPath = @"D:\Falownik\Inputs\";

            //string sDirectoryPath = @"G:\Fotowoltaika\";

            using (ProviderMsAccess prov = new ProviderMsAccess(@"C:\Users\Szymon\Documents\baza.accdb"))
            {
                FroniusSymoLog log = new FroniusSymoLog();

                var temp = log.GetProduction(sDirectoryPath);

                prov.InsertProduction(temp);
            }
        }
Exemplo n.º 3
0
        private void button7_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog open = new OpenFileDialog())
            {
                if (open.ShowDialog(this) == DialogResult.OK)
                {
                    string sTauronLogFilePath = open.FileName; //@"D:\Falownik\Tauron\Dane.xls"

                    using (ProviderMsAccess prov = new ProviderMsAccess(@"C:\Users\Szymon\Documents\baza.accdb"))
                    {
                        Tauron.TauronLog log = new Tauron.TauronLog();
                        //var lista = log.GetTauronLogData(sTauronLogFilePath);
                        var lista = log.GetTauronLogDataCSV(sTauronLogFilePath);

                        prov.InsertTauronLog(lista);
                    }
                }
            }

            MessageBox.Show(this, "Import zakończone!!", "Import Tauron", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }