// Delete the record from the table private void btnDelete_Click(object sender, EventArgs e) { HolidayDbCommand.DeleteHoliday(holiday); ReconnectTable(); ClearBindings(); AddBindings(); RecordCounter(); }
// Update the current record displaying private void btnUpdate_Click(object sender, EventArgs e) { bool checkHolidayInput = CheckHolidayInput(); DisconnectTable(); if (checkHolidayInput) { Holiday holidayData = this.HolidayData(holiday); HolidayDbCommand.UpdateHoliday(HolidayData(holiday)); } ConnectTable(); ClearBindings(); AddBindings(); }
// Check if inputs are in correct format // If yes the the record will be added to the table private void btnSave_Click(object sender, EventArgs e) { bool checkHolidayInput = CheckHolidayInput(); if (checkHolidayInput) { btnAdd.Visible = true; btnSave.Visible = false; Holiday holidayData = this.HolidayData(holiday); HolidayDbCommand.AddHoliday(holidayData); ReconnectTable(); AddBindings(); RecordCounter(); } else { ReconnectTable(); } }
// Print all the records to a textfile private void btnPrint_Click(object sender, EventArgs e) { HolidayDbCommand.PrintHoliday(); }