/// <summary> /// Raises the SaveSettingsEvent safely. /// </summary> /// <param name="settings"></param> private void RaiseSaveSettingsEvent(LessonFees settings) { if (SaveSettings != null) { SaveSettings(settings); } }
/// <summary> /// Initializes a new instance of the Tennis_Management_Software.SettingsForm class. /// </summary> /// <param name="fees">The values to set the NumericUpDowns.</param> public SettingsForm(LessonFees fees) { InitializeComponent(); privateLessonNumUpDown.Value = (decimal)fees.PrivateFee; groupLessonNumUpDown.Value = (decimal)fees.GroupFee; semiPrivateNumUpDown.Value = (decimal)fees.SemiPrivateFee; }
private void saveButton_Click(object sender, EventArgs e) { const int decimalPlaces = 2; LessonFees settings = new LessonFees((float)Math.Round(privateLessonNumUpDown.Value, decimalPlaces), (float)Math.Round(semiPrivateNumUpDown.Value, decimalPlaces), (float)Math.Round(groupLessonNumUpDown.Value, decimalPlaces)); RaiseSaveSettingsEvent(settings); Close(); }
/// <summary> /// Loads all the information. /// </summary> public void Load() { TennisClub tempClass = Serialization.Deserialize <TennisClub>(SaveFilePath); this.studentList = tempClass.studentList; this.coachList = tempClass.coachList; this.lesson_Fees = tempClass.lesson_Fees; }
/// <summary> /// Initializes a new instance of the Tennis_Management_Software.TennisClub class. /// </summary> public TennisClub() { studentList = new List <Student>(); coachList = new List <Coach>(); lesson_Fees = new LessonFees(); CreateFolderIfNotExist(MainFolderName); CreateFolderIfNotExist(StudentPicturesFolder); CreateFolderIfNotExist(CoachPictureFolder); }
private void settingsForm_SaveSettings(LessonFees fees) { Tennis_Club.Lesson_Fees = fees; DisplayStudentInfo(personInfo.ID); UpdateStatInfoLabelText(); }