/// <summary> /// given: Open student form in frame /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void studentToolStripMenuItem_Click(object sender, EventArgs e) { frmStudent instStudent = new frmStudent(); instStudent.MdiParent = this; instStudent.Show(); }
/// <summary> /// Handles the event when the link button for "Update Grade" is clicked. /// Parses the input and updates the grade for the given registration. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void lnkUpdate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { string formatClearedValue = Numeric.ClearFormatting(gradeTextBox.Text, "%"); if (Numeric.isNumeric(formatClearedValue, System.Globalization.NumberStyles.Float)) { double gradeParsed = double.Parse(formatClearedValue); gradeParsed = gradeParsed / 100; if (gradeParsed >= 0 && gradeParsed <= 1) { Registration idToBeUpdated = constructorData.registration; int registrationID = idToBeUpdated.RegistrationId; string notes = idToBeUpdated.Notes; ServiceReference.CollegeRegistrationClient localWS = new ServiceReference.CollegeRegistrationClient(); localWS.updateGrade(gradeParsed, registrationID, notes); frmStudent frmStudent = new frmStudent(constructorData); frmStudent.MdiParent = this.MdiParent; frmStudent.Show(); this.Close(); } else { MessageBox.Show("Grade value is out of range, please enter a value between 0 to 1."); } } else { MessageBox.Show("Please enter grade in decimal format between 0 and 1. Update failed."); } }
/// <summary> /// given: this code will navigate back to frmStudent with /// the specific student and registration data that launched /// this form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void lnkReturn_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { //return to student with the data selected for this form frmStudent frmStudent = new frmStudent(constructorData); frmStudent.MdiParent = this.MdiParent; frmStudent.Show(); this.Close(); }