コード例 #1
0
        private void AddActiveUserFilesToList(object sender, EventArgs e)
        {
            ActiveUserFile activeuserfile = newActiveUserFileSubForm.NewActiveUserFile;

            CaseActiveUserFiles.Add(activeuserfile);
            EntitiesToListView.FillActiveUserFilesListViewDetailView(CaseActiveUserFiles, listViewAUFActiveUserFiles);
        }
コード例 #2
0
        private void buttonRemoveActiveUserFile_Click(object sender, EventArgs e)
        {
            if (listViewAUFActiveUserFiles.SelectedItems.Count == 1 && formEditMode != "view")
            {
                object aufId = listViewAUFActiveUserFiles.SelectedItems[0].Tag;

                var aufToRemove = new ActiveUserFile();
                if (aufId.GetType() == typeof(ActiveUserFile))
                {
                    aufToRemove = (ActiveUserFile)aufId;
                }
                else
                {
                    aufId       = new Guid(aufId.ToString());
                    aufToRemove = CaseActiveUserFiles.SingleOrDefault(x => x.Id == (Guid)aufId);
                    DeleteSingleEntityById.DeleteActiveUserFileById((Guid)aufId);
                }

                CaseActiveUserFiles.Remove(aufToRemove);

                EntitiesToListView.FillActiveUserFilesListViewDetailView(CaseActiveUserFiles, listViewAUFActiveUserFiles);
            }
            else
            {
                MessageBox.Show("Please Select which Active User File to remove");
            }
        }
コード例 #3
0
        private void PopulateFormwithCase(Case incomingCase)
        {
            ISessionFactory factory = SessionConfig.SessionFactory;

            using (ISession session = factory.OpenSession())
            {
                using (ITransaction transaction = session.BeginTransaction())
                {
                    incomingCase = session.CreateCriteria(typeof(Case))
                                   .Add(Restrictions.Eq("Id", incomingCase.Id))
                                   .UniqueResult <Case>();

                    matterTextBox.Text                      = incomingCase.Matter;
                    caseNumberTextBox.Text                  = Math.Truncate(incomingCase.CaseNumber).ToString();
                    itemNumberTextBox.Text                  = incomingCase.ItemNumber.ToString();
                    startDateDateTimePicker.Value           = incomingCase.StartDate;
                    barcodeTextBox.Text                     = incomingCase.Barcode;
                    barcodeDateVerifiedDateTimePicker.Value = incomingCase.BarcodeDateVerified;
                    firm_idComboBox.SelectedValue           = incomingCase.Firm.Id;
                    EntitiesToComboBox.FillFirmContactComboBoxByFirm(incomingCase.Firm.Id, requester_idComboBox);
                    requester_idComboBox.SelectedValue = incomingCase.Requester.Id;
                    examiner_idComboBox.SelectedValue  = incomingCase.Examiner.Id;
                    textBoxConclusion.Text             = incomingCase.NotesAndConclusion.Conclusion;
                    textBoxNACNotes.Text = incomingCase.NotesAndConclusion.Notes;

                    NewCase               = incomingCase;
                    CaseComputers         = incomingCase.Computers;
                    CaseHardDrives        = incomingCase.HardDrives;
                    CaseForensicProcesses = incomingCase.ForensicProcesses;
                    CaseActiveUserFiles   = incomingCase.ActiveUserFiles;

                    EntitiesToListView.FillActiveUserFilesListViewDetailView(CaseActiveUserFiles,
                                                                             listViewAUFActiveUserFiles);
                    EntitiesToListView.FillComputersListview(CaseComputers, listViewAssociatedComputerList);
                    EntitiesToListView.FillHardDrivesListView(CaseHardDrives, listViewHardDrivesOnHardDrivePage);
                    EntitiesToListView.FillForensicProcessListView(CaseForensicProcesses, listViewForensicProcesses);

                    transaction.Commit();
                }
            }
        }