TimeSheetLeaveProcessor.xaml.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Windows;
  3. using FastReport.Data;
  4. using InABox.WPF;
  5. using javax.sql;
  6. using Microsoft.Office.Interop.Outlook;
  7. namespace PRSDesktop
  8. {
  9. public partial class TimeSheetLeaveProcessor : Window
  10. {
  11. private DateTime _from;
  12. private DateTime _to;
  13. public TimeSheetLeaveProcessor(DateTime from, DateTime to)
  14. {
  15. InitializeComponent();
  16. _from = from;
  17. _to = to;
  18. standardleave.From = from;
  19. standardleave.To = to;
  20. standardleave.Refresh(true, true);
  21. leaverequests.From = from;
  22. leaverequests.To = to;
  23. leaverequests.Refresh(true, true);
  24. }
  25. private void OK_OnClick(object sender, RoutedEventArgs e)
  26. {
  27. if (MessageBox.Show("Process these Leave Entries?", "Process Leave", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
  28. {
  29. Progress.ShowModal("Processing Leave", (progress) =>
  30. {
  31. standardleave.Process(progress);
  32. leaverequests.Process(progress);
  33. });
  34. DialogResult = true;
  35. }
  36. }
  37. private void Cancel_OnClick(object sender, RoutedEventArgs e)
  38. {
  39. DialogResult = false;
  40. }
  41. }
  42. }