예제 #1
0
        private void backgroundWorker_DoWork(object sender,
                                             DoWorkEventArgs e)
        {
            // Get the BackgroundWorker that raised this event.
            BackgroundWorker  worker     = sender as BackgroundWorker;
            CredentialsGetter credential = new CredentialsGetter();


            ZucchettiPageDownloader downloader = new ZucchettiPageDownloader();

            TimbratureBuilder localtimbrature = new TimbratureBuilder(Utils.getFirstWorkingDayOfWeekAsDate(dateTimePicker.Value.Date));
            var collection = downloader.DownloadTimbratureCurrentMonth(credential.GetUser(), credential.GetPassword(), (DateTime)e.Argument, localtimbrature, worker);

            e.Result = localtimbrature;

            downloader.Cleanup();
        }