private void createCaseButton_Click(object sender, EventArgs e) { if (_dumbcheck < 2 || noOfJurorsTextBox.Text == "" || caseNameTextbox.Text == "") { MessageBox.Show(this, "Please Fill in the Case Name and Number of Jurors", "Not All Informatin Given", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { List <Info> i = new List <Info>(); foreach (CheckBox cb in checkboxes) { if (cb.Checked) { i.Add(new Info(cb.Text)); } } Case theCase = new Case(caseNameTextbox.Text, Convert.ToInt32(noOfJurorsTextBox.Text)); CaseForm theCaseForm = new CaseForm(theCase, i); theCaseForm.Location = Location; theCaseForm.Size = Size; theCaseForm.StartPosition = FormStartPosition.WindowsDefaultLocation; this.Hide(); theCaseForm.Show(); } }
private void loadCaseButton_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.InitialDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\JurySelectionHelper"; if (openFileDialog.ShowDialog() == DialogResult.OK) { Case theCase = new Case(openFileDialog.FileName); CaseForm theCaseForm = new CaseForm(theCase, null); theCaseForm.Location = Location; theCaseForm.Size = Size; theCaseForm.StartPosition = FormStartPosition.WindowsDefaultLocation; this.Hide(); theCaseForm.Show(); } }