private void buttonGetTimeEntries_Click(object sender, RoutedEventArgs e)
        {
            if (LbUsers.HasItems)
            {
                if (LbUsers.SelectedItems.Count == 0)
                {
                    LbUsers.SelectAll();
                }

                List <TpUser> selectedUsers = (from object item in LbUsers.SelectedItems select item as TpUser).ToList();

                List <TpProject> selectedProjects =
                    (from object item in LbProjects.SelectedItems select item as TpProject).ToList();

                string filename =
                    _vm.GenerateCsv(
                        _vm.GetTimeEntriesForUsersAndProjects(selectedUsers, selectedProjects, TextBoxStartDate.Text,
                                                              TextBoxEndDate.Text), TextBoxStartDate.Text,
                        TextBoxEndDate.Text);

                //MessageBox.Show("Finished!");
                Process.Start(filename);
            }
            else
            {
                MessageBox.Show("Please select one or more projects and click 'Refresh' to update the list of users");
            }
        }
 private void buttonSelectAllUsers_Click(object sender, RoutedEventArgs e)
 {
     LbUsers.SelectAll();
     //foreach (ListBoxItem item in LbUsers.Items)
     //{
     //    item.IsSelected = !item.IsSelected;
     //}
 }
        private void ButtonMeOnly_OnClick(object sender, RoutedEventArgs e)
        {
            LbProjects.SelectedItems.Clear();
            LbProjects.SelectAll();

            foreach (object item in LbUsers.Items)
            {
                if (((TpUser)item).Login == Settings.Default.Login)
                {
                    LbUsers.SelectedItems.Add((item));
                    LbUsers.ScrollIntoView(item);
                }
            }
        }
        private void buttonQCMMSD_Click(object sender, RoutedEventArgs e)
        {
            LbProjects.SelectedItems.Clear();
            foreach (object item in LbProjects.Items)
            {
                if (((TpProject)item).Company == "Madison Metropolitan Sewerage District")
                {
                    LbProjects.SelectedItems.Add(item);
                }
            }
            List <TpUser> userList = _vm.RefreshUserList(LbProjects.SelectedItems, TextBoxStartDate.Text,
                                                         TextBoxEndDate.Text);

            LbUsers.ItemsSource = userList;
            LbUsers.SelectAll();
            _vm.SelectedProject = "MMSD";
        }
        private void buttonQCWIDS_Click(object sender, RoutedEventArgs e)
        {
            LbProjects.SelectedItems.Clear();
            foreach (object item in LbProjects.Items)
            {
                if (((TpProject)item).Company == "Wisconsin Technical College Foundation")
                {
                    LbProjects.SelectedItems.Add(item);
                }
            }
            List <TpUser> userList = _vm.RefreshUserList(LbProjects.SelectedItems, TextBoxStartDate.Text,
                                                         TextBoxEndDate.Text);

            LbUsers.ItemsSource = userList;
            LbUsers.SelectAll();
            _vm.SelectedProject = "WIDS";
        }