Beispiel #1
0
        private void ReportTable_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (ReportTable.SelectedItems.Count > 0)
            {
                Passlog    selectedLog = (Passlog)ReportTable.SelectedItem;
                int        logId       = selectedLog.logId;
                List <int> test        = (List <int>)Application.Current.Resources["logIdList"];
                test.Remove(logId);
                ReportTable.Items.Remove(ReportTable.SelectedItem);

                Application.Current.Resources["logIdList"] = test;
            }
        }
Beispiel #2
0
        private void LogTable_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Passlog    selectedLog = (Passlog)LogTable.SelectedItem;
            List <int> test        = (List <int>)Application.Current.Resources["logIdList"];


            if (!test.Contains(selectedLog.logId))
            {
                ReportTable.Items.Add(selectedLog);
                test.Add(selectedLog.logId);
            }
            Application.Current.Resources["logIdList"] = test;
        }
Beispiel #3
0
        private void Report_Click(object sender, RoutedEventArgs e)
        {
            string command = Report.Content.ToString();

            if (command == "Report Suspicious Activity")
            {
                LogTable.HeadersVisibility = DataGridHeadersVisibility.All;
                errorMsg.Content           = "To add, click the left buttons of the suspicious entries from the above table to add into the bottom table. If you clicked the wrong entry, remove it by clicking the left button" +
                                             "of the wrong entry from the bottom table   ";
                ReportTable.Items.Clear();
                Reporting.Visibility = Visibility.Visible;
                Report.Content       = "Submit";
            }
            else
            {
                List <int> test = (List <int>)Application.Current.Resources["logIdList"];
                if (test.Count != 0)
                {
                    OTP hello = new OTP();
                    hello.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                    hello.ShowDialog();


                    if (hello.DialogResult == true)
                    {
                        Passlog.lockDown(test, getUserId());
                        LogTable.HeadersVisibility = DataGridHeadersVisibility.Column;
                        errorMsg.Content           = null;
                        test.Clear();
                        Application.Current.Resources["logIdList"] = test;
                        Reporting.Visibility = Visibility.Collapsed;
                        ReportTable.Items.Clear();
                        Report.Content = "Report Suspicious Activity";
                        MessageBox.Show("Report Submitted. Our Tech Support will contact you shortly");
                    }

                    else
                    {
                        MessageBox.Show("OTP not entered correctly");
                    }
                }
                else
                {
                    MessageBox.Show("Please select entries before submitting.");
                }
            }
        }
Beispiel #4
0
        private void fillTable()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            List <Passlog> logEntries = Passlog.retrieveLogs(getUserId());



            if (logEntries != null)
            {
                LogTable.ItemsSource = logEntries;

                errorMsg.Content = null;
            }
            else
            {
                LogTable.Visibility = Visibility.Collapsed;

                errorMsg.Content = "No entries yet";
            }

            Mouse.OverrideCursor = null;
        }