Beispiel #1
0
        // Delete the record from the table
        private void btnDelete_Click(object sender, EventArgs e)
        {
            HolidayDbCommand.DeleteHoliday(holiday);

            ReconnectTable();
            ClearBindings();
            AddBindings();
            RecordCounter();
        }
Beispiel #2
0
        // 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();
        }
Beispiel #3
0
        // 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();
            }
        }
Beispiel #4
0
 // Print all the records to a textfile
 private void btnPrint_Click(object sender, EventArgs e)
 {
     HolidayDbCommand.PrintHoliday();
 }