private void btn_SignEnd_Click(object sender, RoutedEventArgs e) { // This is same as the previous but reverse. This ends the workday try { AddFirstEntry controls = new AddFirstEntry(); controls.AddLastEntry(); txtb_IsOk2.Text = "Ok!"; btn_SignEnd.IsEnabled = false; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btn_SignToWork_OK_Click(object sender, RoutedEventArgs e) { // This button allows employee to start their workday try { AddFirstEntry controls = new AddFirstEntry(); // In the next method happens all the sql magic. You can find it under classes and viewmodel controls.AddNewEntry(); // also disable the button for this session because why would you start workday two times per day ((MainWindow)Application.Current.MainWindow).txtb_IsOk1.Text = "OK!"; ((MainWindow)Application.Current.MainWindow).btn_SignStart.IsEnabled = false; this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }