private void AddComputerTolist(object sender, EventArgs e)
        {
            Computer computer = newCompSubform.NewComputer;

            computer.HardDrives.ForEach(hd => CaseHardDrives.Add(hd));
            CaseComputers.Add(computer);
            EntitiesToListView.FillComputersListview(CaseComputers, listViewAssociatedComputerList);
            EntitiesToListView.FillHardDrivesListView(CaseHardDrives, listViewHardDrivesOnHardDrivePage);
        }
        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();
                }
            }
        }
        private void listViewAssociatedComputerList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listViewAssociatedComputerList.SelectedItems.Count == 1)
            {
                int i = listViewAssociatedComputerList.SelectedItems[0].Index;

                this_Computer = CaseComputers[i];
                //Puts computer info in fields
                ListViewToDetailsFields.ComputerlistViewToDetailFields(i, CaseComputers, this);

                //puts the hard drives in their listView.
                EntitiesToListView.FillHardDrivesListView(CaseComputers[i].HardDrives,
                                                          listViewComputerAssociatedHardDrives);
                listViewComputerAssociatedHardDrives.View = View.LargeIcon;

                listViewAssociatedRaids.Clear();
                if (CaseComputers[i].Raids.Count > 0)
                {
                    EntitiesToListView.FillHardRaidsListViewDetailView(CaseComputers[i].Raids, listViewAssociatedRaids);
                }

                groupBoxDriveDetails.Controls.OfType <TextBox>().ForEach(x => x.Text = "");
            }
        }
 private void AddHardDriveTolist(object sender, EventArgs e)
 {
     CaseHardDrives.Add(newHardDriveSubForm.NewHardDrive);
     EntitiesToListView.FillHardDrivesListView(CaseHardDrives, listViewHardDrivesOnHardDrivePage);
 }