private void ParkButton_Click(object sender, EventArgs e)
        {
            //Do everything the same as "Close" but minimize the form instead
            LogXDataBase lgdb = new LogXDataBase();

            if (NotesTextBox.Text != null)
            {
                lgdb.AddNote(LogDateTimePicker.Value.ToShortDateString(), NotesTextBox.Text);
            }

            List <string> taskList = new List <string>();

            foreach (DataGridViewRow task in TaskDataGrid.Rows)
            {
                var taskName = task.Cells[0].Value;
                if (taskName != null)
                {
                    bool taskDone = Convert.ToBoolean(task.Cells[1].Value);
                    if (!taskDone && (taskName != null))
                    {
                        taskList.Add(taskName.ToString());
                    }
                }
            }
            lgdb.AddTasks(taskList);

            this.WindowState = FormWindowState.Minimized;
            return;
        }
        private void CloseButton_Click(object sender, EventArgs e)
        {
            LogXDataBase lgdb = new LogXDataBase();

            if (NotesTextBox.Text != null)
            {
                lgdb.AddNote(LogDateTimePicker.Value.ToShortDateString(), NotesTextBox.Text);
            }

            List <string> taskList = new List <string>();

            foreach (DataGridViewRow task in TaskDataGrid.Rows)
            {
                var taskName = task.Cells[0].Value;
                if (taskName != null)
                {
                    bool taskDone = Convert.ToBoolean(task.Cells[1].Value);
                    if (!taskDone && (taskName != null))
                    {
                        taskList.Add(taskName.ToString());
                    }
                }
            }
            lgdb.AddTasks(taskList);

            Close();
            return;
        }
        private void LogDateTimePicker_ValueChanged(object sender, EventArgs e)
        {
            //fill in notes
            string[]     lglines;
            LogXDataBase lgdb = new LogXDataBase();

            char[] splt  = { '*' };
            string lgstr = lgdb.GetNote(LogDateTimePicker.Value.ToShortDateString());

            if (lgstr != null)
            {
                lglines = lgstr.Split(splt, StringSplitOptions.RemoveEmptyEntries);
                foreach (string lg in lglines)
                {
                    NotesTextBox.AppendText("*" + lg + "\r\n");
                }
                return;
            }
            return;
        }
        public FormNightShift()
        {
            InitializeComponent();
            // Acquire the version information and put it in the form header
            try { this.Text = ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString(); }
            catch { this.Text = " in Debug"; } //probably in debug, no version info available
            this.Text = "NightShift V" + this.Text;

            TargetSpecs ts = new TargetSpecs("Sun");

            SunRiseTextBox.Text  = ts.RiseTime.ToString(@"hh\:mm");
            SunSetTextBox.Text   = ts.SetTime.ToString(@"hh\:mm");
            TwilightTextBox.Text = ts.TwilightEODTime.ToString(@"hh\:mm");
            DawnTextBox.Text     = ts.TwilightSODTime.ToString(@"hh\:mm");

            TargetSpecs tm = new TargetSpecs("Moon");

            MoonRiseTextBox.Text    = tm.RiseTime.ToString(@"hh\:mm");
            MoonSetTextBox.Text     = tm.SetTime.ToString(@"hh\:mm");
            MoonTransitTextBox.Text = tm.TransitTime.ToString(@"hh\:mm");
            MoonPhaseTextBox.Text   = (tm.PhasePercent.ToString("0")) + "%";

            //Test to see which buttons have installed applications
            QualifyToolKitButtons();

            //Load the Target Plan datagridview
            WriteTargetList();

            //Load the task list datagridview
            LogXDataBase  tldb     = new LogXDataBase();
            List <string> taskList = tldb.GetTasks();

            TaskDataGrid.Rows.Clear();
            int tidx = 0;

            if (taskList != null)
            {
                foreach (string task in taskList)
                {
                    TaskDataGrid.Rows.Add();
                    TaskDataGrid.Rows[tidx].Cells[0].Value = task;
                    TaskDataGrid.Rows[tidx].Cells[1].Value = false;
                    tidx++;
                }
            }
            Show();
            TaskDataGrid.ClearSelection();
            //Set the display date the the current date
            LogDateTimePicker.Value = DateTime.Now;
            //Create Humason Log content for Humason Log tab
            //Open log based on the most recent log
            HumasonReader hReader = new HumasonReader(DateTime.Now);
            //Get full list of logs in Log directory
            List <DateTime> hLogList = hReader.HumasonLogDates;

            foreach (DateTime ldate in hLogList)
            {
                HumasonLogFileListBox.Items.Add(ldate.ToShortDateString());
            }
            HumasonLogFileListBox.SelectedIndex = HumasonLogFileListBox.Items.Count - 1;
            Show();
            return;
        }