Пример #1
0
        private void SetupControls()
        {
            _controls = new ControlsAccess();
            _events   = new EventViewController(_controls);
            _messages = new MessageViewController(_controls);
            Setup();

            if (!_events.LoadEvents())
            {
                MessageBox.Show("Unable to save some or all events.", "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                _error = true;
            }

            EIV.UpdateEvents(DateTime.Today);
            SEIV.UpdateEvents();
            UpdateEventList();

            if (!_messages.LoadMessages())
            {
                MessageBox.Show("Unable to save some or all messages.", "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                _error = true;
            }

            MMV.UpdateMessagesView();
        }
Пример #2
0
        private void ImportAllDataToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult fileDialogResult = OpenFileDialog.ShowDialog();

            if (fileDialogResult == DialogResult.OK)
            {
                DialogResult overwriteResult = MessageBox.Show("Overwrite current data?\r\nThis will wipe all local data.", "Overwrite data", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                BackupIOConsts.ArchiveOldAll();
                if (!_messages.LoadMessages(OpenFileDialog.FileName, overwriteResult == DialogResult.Yes) ||
                    !_events.LoadEvents(OpenFileDialog.FileName, overwriteResult == DialogResult.Yes))
                {
                    MessageBox.Show("Unable to import some or all events and/or messages.", "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }