private void RunJob(DateTime from, DateTime to) { RunVizzitJob runJob; errorTextBox.Text = ""; List <DateTime> allDates = new List <DateTime>(); for (DateTime date = from; date <= to; date = date.AddDays(1)) { allDates.Add(date); } List <string> dateArray = new List <string>(); foreach (DateTime dt in allDates) { dateArray.Add(dt.ToString("yyMMdd")); } try { runJob = new RunVizzitJob(Properties.Settings.Default["LogDir"].ToString(), Properties.Settings.Default["CustomerId"].ToString(), dateArray); errorTextBox.Text = "Jobb klart"; } catch (Exception ex) { errorTextBox.Text = ex.Message; } }
private void RunJob() { RunVizzitJob runJob; List <string> dateList = new List <string>(); string date = DateTime.Now.AddDays(-1).ToString("yyMMdd"); dateList.Add(date); try { runJob = new RunVizzitJob(VizzitLogFetcher.Properties.Settings.Default["LogDir"].ToString(), VizzitLogFetcher.Properties.Settings.Default["CustomerId"].ToString(), dateList); } catch (Exception ex) { MessageBox.Show(ex.Message); } Application.Current.Shutdown(); }