private void MakeHardDrive() { NewHardDrive = new HardDrive { //hard drive information Make = comboBoxHDMake.Text, Model = comboBoxHDModel.Text, Type = comboBoxHDType.Text, Serial = textBoxSerialNum.Text, SizeInGB = Convert.ToDecimal(textBoxSize.Text), DriveInterface = RadioButtonListUtilities.ExtractTextFromRadioButtonGroup(groupBoxDriveInterface), DrivePosition = RadioButtonListUtilities.ExtractTextFromRadioButtonGroup( groupBoxDrivePostitionAsInstalled), JumperSetting = RadioButtonListUtilities.ExtractTextFromRadioButtonGroup(groupBoxJumperSettings), JumperDiagram = jumperDiagram, CDFInfo = new CdfInfo { IsFinishDate = true, Cdfdate = dateTimePickerCDFDate.Value, TechExaminer = SelectSingleEntityById.SelectEmployeeById( new Guid(comboBoxCdfInfoTech.SelectedValue.ToString())), } }; }
//Create Entity Event private void MakeActiveUserFile() { NewActiveUserFile = new ActiveUserFile { ReferenceComputer = (Computer)comboBoxAUFReferenceComputer.SelectedValue, FileName = textBoxAUFFileName.Text, Description = textBoxAUFDescription.Text, MemoryUsage = decimal.Parse(textBoxAUFMemoryUsage.Text == String.Empty ? "0" : textBoxAUFMemoryUsage.Text), CpuUsage = decimal.Parse(textBoxAUFCPUUsage.Text == String.Empty ? "0" : textBoxAUFCPUUsage.Text), CdfInfo = new CdfInfo { TechExaminer = SelectSingleEntityById.SelectEmployeeById( new Guid(comboBoxCdfInfoTech.SelectedValue.ToString())), IsFinishDate = true, Cdfdate = dateTimePickerCDFDate.Value, } }; }
private void MakeForensicProcess() { IList <HardDrive> selectedHardDrives = new List <HardDrive>(); IList <Computer> selectedComputers = new List <Computer>(); foreach (object item in checkedListBoxAssociatedhardDrives.CheckedItems) { int i = checkedListBoxAssociatedhardDrives.Items.IndexOf(item); selectedHardDrives.Add(SelectableAssociatedHardDrives.ElementAt(i)); } foreach (object item in checkedListBoxAssociatedcomputers.CheckedItems) { int i = checkedListBoxAssociatedcomputers.Items.IndexOf(item); selectedComputers.Add(SelectableAssociatedComputers.ElementAt(i)); } NewForensicProcess = new ForensicProcess { //collection onformation CollectionLocation = textBoxCollectionLocation.Text, RoomNumber = textBoxRoomNumber.Text, CustodianOrUser = textBoxCustodianUser.Text, PhotoWasTaken = checkBoxPhotosWereTaken.Checked, WasImageOnly = checkBoxOnlyImageWasReceived.Checked, WasHardDriveOnly = checkBoxOnlyHardDriveWasReceived.Checked, ProcessingPerformed = comboBoxProcessPerformed.Text, ForensicDeviceUsed = comboBoxDeviceUsed.Text, Software = comboBoxSoftwareProcessing.Text, ImagesMade = comboBoxImagesMade.Text, ImagesVerifiedBy = comboBoxImagesVerifiedBy.Text, CdfInfo = new CdfInfo { IsFinishDate = true, Cdfdate = dateTimePickerFPFinishDateTime.Value, TechExaminer = SelectSingleEntityById.SelectEmployeeById( new Guid(comboBoxCDFInfoTech.SelectedValue.ToString())) }, DestinationMediae = ForensicProcessDestinationMediae, ReferenceHardDrives = selectedHardDrives, ReferenceComputers = selectedComputers, }; ForensicProcessDestinationMediae.ToList().ForEach(dm => dm.SerialNumber = NewForensicProcess.ToString()); }
private void MakeComputer() { NewComputer = new Computer { //General Info Make = comboBoxMake.Text, Model = comboBoxModel.Text, Type = comboBoxType.Text, SerialNumber = txtSerialNum.Text, SvcTag = txtSvcTag.Text, //CMOS CmosDate = dateTimePickerCMOS.Value, CurrentDate = dateTimePickerActualDate.Value, ActualTimeProvidedBy = comboBoxTimeProvidedBy.Text, KeystrokeForCmosSetup = comboBoxSetupKeystroke.Text, CmosWasChanged = checkBoxCmosChanged.Checked, DescriptionOfCmosChanges = txtCMOSChangesMade.Text, //System Info SystemWasRunning = checkBoxSystemWasRunning.Checked, PlugWasPulled = checkBoxPlugWasPulled.Checked, AppsWereRunning = checkBoxAppsWereRunning.Checked, WhoShutDown = SelectSingleEntityById.SelectEmployeeById( new Guid(comboBoxShutDownBy.SelectedValue.ToString())), WasPoweredOn = checkBoxSystemWasPoweredOn.Checked, WasServer = checkBoxSystemWasServer.Checked, ServerType = comboBoxServerType.Text, WasVirtualMachine = checkBoxWasVirtualMachine.Checked, WasHostedSystem = checkBoxWasHostedSystem.Checked, Hostname = textBoxHostname.Text, //HD + Raid HardDrives = ComputerHardDrives, Raids = ComputerRaids, //CdfInfo CdfInfo = new CdfInfo { IsFinishDate = true, Cdfdate = dateTimePickerCDFDate.Value, TechExaminer = SelectSingleEntityById.SelectEmployeeById( new Guid(comboBoxCdfInfoTech.SelectedValue.ToString())) }, }; ComputerHardDrives.ToList().ForEach(hd => hd.ReferenceComputer = NewComputer); }
// Save and Cancel Buttons private void SaveButton_Click(object sender, EventArgs e) { if ( MessageBox.Show( "Are you sure you wish to save? Your changes to this Case will be applied to the daabase, and this form will close.", "Confirm Save", MessageBoxButtons.YesNo) == DialogResult.Yes) { ISessionFactory factory = SessionConfig.SessionFactory; using (ISession session = factory.OpenSession()) { Firm caseFirm = SelectSingleEntityById.SelectFirmById(new Guid(firm_idComboBox.SelectedValue.ToString())); FirmContact caseRequester = SelectSingleEntityById.SelectFirmContactById( new Guid(requester_idComboBox.SelectedValue.ToString())); Employee caseExmployee = SelectSingleEntityById.SelectEmployeeById(new Guid(examiner_idComboBox.SelectedValue.ToString())); var caseNotesAndConclusion = new NotesAndConclusion { Notes = textBoxNACNotes.Text, Conclusion = textBoxConclusion.Text, CdfInfo = new CdfInfo { TechExaminer = SelectSingleEntityById.SelectEmployeeById (new Guid( comboBoxCdfInfoTech.SelectedValue. ToString())), IsFinishDate = true, Cdfdate = dateTimePickerCDFDate.Value, } }; if (formEditMode.ToLower() == "create") { NewCase = new Case { CaseNumber = Convert.ToInt32(caseNumberTextBox.Text), Matter = matterTextBox.Text, ItemNumber = Convert.ToInt32(itemNumberTextBox.Text), StartDate = startDateDateTimePicker.Value, Barcode = barcodeTextBox.Text, BarcodeDateVerified = barcodeDateVerifiedDateTimePicker.Value, Firm = caseFirm, Requester = caseRequester, Examiner = caseExmployee, Computers = CaseComputers, HardDrives = CaseHardDrives, ForensicProcesses = CaseForensicProcesses, ActiveUserFiles = CaseActiveUserFiles, NotesAndConclusion = caseNotesAndConclusion, }; } else if (formEditMode.ToLower() == "edit") { NewCase.CaseNumber = Convert.ToDecimal(caseNumberTextBox.Text); NewCase.Matter = matterTextBox.Text; NewCase.ItemNumber = Convert.ToInt32(itemNumberTextBox.Text); NewCase.StartDate = startDateDateTimePicker.Value; NewCase.Barcode = barcodeTextBox.Text; NewCase.BarcodeDateVerified = barcodeDateVerifiedDateTimePicker.Value; NewCase.Firm = caseFirm; NewCase.Requester = caseRequester; NewCase.Examiner = caseExmployee; NewCase.Computers = CaseComputers; NewCase.HardDrives = CaseHardDrives; NewCase.ForensicProcesses = CaseForensicProcesses; NewCase.ActiveUserFiles = CaseActiveUserFiles; NewCase.NotesAndConclusion = caseNotesAndConclusion; } else { MessageBox.Show("Invalid Form Edit Mode : Please Restart Appliction."); } NewCase.NotesAndConclusion.ReferenceCase = NewCase; using (ITransaction transaction = session.BeginTransaction()) { if (formEditMode.ToLower() == "create") { session.Save(NewCase); } else if (formEditMode.ToLower() == "edit") { session.Update(NewCase); } transaction.Commit(); } } Close(); } }