private void newReportConfirmButton_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(reportNameLabel.Text) || String.IsNullOrEmpty(scoreTextBox1.Text) || String.IsNullOrEmpty(scoreTextBox2.Text)) { MessageBox.Show("All fields are required"); } else { string droppedText = ""; if (droppedCheckBox.Checked == true) { droppedText = "Dropped"; } classCategoryReportList.gradeReportList.Add(new GradeReport { gradeReportName = reportNameTextBox.Text, gradeReportScore = float.Parse(scoreTextBox1.Text), maxPoints = Int32.Parse(scoreTextBox2.Text), droppedString = droppedText }); int categoryIndex = classInformationForm.gradeCategoriesListBox.SelectedIndex; classInformationForm.viewCategoryButton_Click(sender, e); classInformationForm.UpdateInformation(sender, e); classInformationForm.gradeCategoriesListBox.SelectedIndex = categoryIndex; classInformationForm.gradeReportListBox.SelectedIndex = -1; this.Close(); } }
private void newReportConfirmButton_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(reportNameLabel.Text) || String.IsNullOrEmpty(scoreTextBox1.Text) || String.IsNullOrEmpty(scoreTextBox2.Text)) { MessageBox.Show("All fields are required"); } else { if (droppedCheckBox.Checked == true) { tempClassCategoriesContainer.classContainerList[categoriesIndex].gradeReportList[reportsIndex].droppedString = "Dropped"; } else { tempClassCategoriesContainer.classContainerList[categoriesIndex].gradeReportList[reportsIndex].droppedString = ""; } tempClassCategoriesContainer.classContainerList[categoriesIndex].gradeReportList[reportsIndex].gradeReportName = reportNameTextBox.Text; tempClassCategoriesContainer.classContainerList[categoriesIndex].gradeReportList[reportsIndex].maxPoints = Int32.Parse(scoreTextBox2.Text); tempClassCategoriesContainer.classContainerList[categoriesIndex].gradeReportList[reportsIndex].gradeReportScore = float.Parse(scoreTextBox1.Text); int getIndex = classInformationForm.gradeCategoriesListBox.SelectedIndex; classInformationForm.viewCategoryButton_Click(sender, e); classInformationForm.UpdateInformation(sender, e); classInformationForm.gradeCategoriesListBox.SelectedIndex = getIndex; classInformationForm.gradeReportListBox.SelectedIndex = -1; this.Close(); } }
private void newCategoryConfirmButton_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(weightedPercentageTextBox.Text) || String.IsNullOrEmpty(categoryTextBox.Text)) { MessageBox.Show("All fields are required"); } else { tempClassCategoriesContainer.classContainerList.Add(new ClassCategory { categoryName = categoryTextBox.Text, categoryWeight = Int32.Parse(weightedPercentageTextBox.Text) }); classInformationForm.UpdateInformation(sender, e); this.Close(); } }