Exemplo n.º 1
0
        private async void btn_start_Click(object sender, RoutedEventArgs e)
        {
            if (appliedcheck == "False")
            {
                MessageBox.Show("Please apply your changes before starting the automated timesheet.");
            }
            else
            {
                if (btn_start.Content.ToString() == ("Start"))
                {
                    var MyIni = new IniFile("Settings.ini");

                    //Should probably be writing the choices they have made prior to pressing Start instead of reading old values
                    //browserchoice = MyIni.Read("Browser", "Browser Choice");
                    //securitychoice = MyIni.Read("Security", "Security Choice");
                    //browserclose = MyIni.Read("CloseBrowser", "Check");
                    //appliedcheck = MyIni.Read("Applied", "Check");
                    //Causing issues with copy of VIP ID
                    //Notification.Bubble("Filling out your timesheet, be prepared to authenticate");

                    MyIni.Write("Browser", comboBrowser.SelectedItem.ToString(), "Browser Choice");
                    MyIni.Write("Security", comboSecurity.SelectedItem.ToString(), "Security Choice");
                    MyIni.Write("ManualSubmit", fridayCheckBox.IsChecked.ToString(), "Submit");
                    MyIni.Write("CloseBrowser", ChkCloseAfterUpdate.IsChecked.ToString(), "Check");
                    browserchoice  = MyIni.Read("Browser", "Browser Choice");
                    securitychoice = MyIni.Read("Security", "Security Choice");
                    browserclose   = MyIni.Read("CloseBrowser", "Check");
                    appliedcheck   = MyIni.Read("Applied", "Check");

                    btn_start.Content = "Stop";
                    await TimeSheet.StartTimesheet();
                }
                else
                {
                    Browser.Close();
                    btn_start.Content = "Start";
                }
            }
        }
Exemplo n.º 2
0
 public async Task Execute(IJobExecutionContext context)
 {
     await TimeSheet.StartTimesheet();
 }