private void saveActivity()
        {
            bool valid = validateEntry();

            if (!valid)
            {
                return;
            }

            //Need to create the service sheet / day entities and save
            ServiceSheetViewModel serviceSheetCreated = new ServiceSheetViewModel(SelectedUser, SelectedActivity, StartDate, EndDate);

            //Now save
            serviceSheetCreated.SaveToModel();
            bool saveSuccessful = DbServiceSheet.saveSheetsAndDays(serviceSheetCreated);

            if (!saveSuccessful)
            {
                MessageBox.Show("Error saving to database.  Need to show error message!");
                return;
            }
            else
            {
                MessageBox.Show("Activity added to database");
            }
        }
Ejemplo n.º 2
0
        private void saveToDatabase()
        {
            //Export to csv
            bool csvExportSuccessful = exportCsvData();

            if (!csvExportSuccessful)
            {
                MessageBox.Show("Error exporting to csv.  Database save not completed");
                return;
            }

            bool saveSuccessful = DbServiceSheet.saveSheetsAndDays(AllServiceSheets);

            if (!saveSuccessful)
            {
                MessageBox.Show("Error saving to database.  Need to show error message!");
                return;
            }
        }