Esempio n. 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();
        }
Esempio n. 2
0
        private void CreateEvent_Click(object sender, EventArgs e)
        {
            if (_events.Add())
            {
                if (!_events.SaveEvents())
                {
                    MessageBox.Show("Unable to save some or all events.", "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                EIV.ClearEventInfo();
                EIV.UpdateEvents(EventCal.GetControl().SelectionRange.Start);
                EIV.ToggleButtons();

                RefreshEventSearch();
            }
        }
Esempio n. 3
0
        private void TimeTicker_Tick(object sender, EventArgs e)
        {
            Time   time       = TimeAndDateUtility.GetCurrentTime();
            string timeString = TimeAndDateUtility.ConvertTime_String(time);

            User_Time.SetText(timeString);
            NextUpdateProgress.Value = time.Seconds % 15;

            if (time.Seconds % 15 == 0)
            {
                UpdateEventList();
            }

            if (time.Seconds % 5 == 0)
            {
                EIV.UpdateEventDetailView();
                SEIV.UpdateEventDetailView();
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Creates a view within a popup form
        /// </summary>
        /// <param name="purpose">The purpose of the form</param>
        /// <param name="event">The event</param>
        public void CreateView(CrudPurposes purpose, SavedEvent @event = null)
        {
            if (purpose == CrudPurposes.Error)
            {
                Error.Visible = true;
                EIV.Visible   = false;
            }
            else
            {
                Error.Visible = false;
                EIV.Visible   = true;
                EIV.SetControls(_id, _controls);
                EIV.SetPurpose(purpose);
            }

            if (purpose == CrudPurposes.Edit)
            {
                EIV.SetValues(@event);
            }
        }
Esempio n. 5
0
        private void GeneralForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResultData <SavedEvent> data = EIV.Data;
            SavedEvent   result = data.Results;
            DialogResult dialog = data.DialogResult;

            if (dialog == DialogResult.OK && result != null)
            {
                Data.Results      = result;
                Data.DialogResult = dialog;
                EIV.CleanUp();
            }
            else if (dialog == DialogResult.None)
            {
                e.Cancel = true;
            }
            else
            {
                e.Cancel          = false;
                Data.DialogResult = dialog;
                EIV.CleanUp();
            }
        }
Esempio n. 6
0
        private void Setup()
        {
            Tag = _controls.AddForm(this);
            string tag = Tag as string;

            TimeLbl.Tag            = _controls.Add(tag, new LabelController(TimeLbl));
            DateLbl.Tag            = _controls.Add(tag, new LabelController(DateLbl));
            LastUpdatedLbl.Tag     = _controls.Add(tag, new LabelController(LastUpdatedLbl));
            StartDateLbl.Tag       = _controls.Add(tag, new LabelController(StartDateLbl));
            EndDateLbl.Tag         = _controls.Add(tag, new LabelController(EndDateLbl));
            EventCalendar.Tag      = _controls.Add(tag, new CalendarController(EventCalendar));
            EventListView.Tag      = _controls.Add(tag, new ListViewController(EventListView));
            SearchTextTb.Tag       = _controls.Add(tag, new TextBoxController(SearchTextTb));
            MessageDisplayTb.Tag   = _controls.Add(tag, new TextBoxController(MessageDisplayTb));
            EventSearchStartDp.Tag = _controls.Add(tag, new DatePickerController(EventSearchStartDp));
            EventSearchEndDp.Tag   = _controls.Add(tag, new DatePickerController(EventSearchEndDp));

            EIV.SetControls(tag, _controls, _events, EventCal.GetId());
            EIV.SetTitle("Events for Day");
            EIV.UseCrudButtons(true);

            SEIV.SetControls(tag, _controls, _events, EventCal.GetId());
            SEIV.SetTitle("Events");
            SEIV.UseCrudButtons(false);

            MMV.SetControls(tag, _controls, _messages);
            MMV.SetTitle("Messages");

            User_Time.SetText(TimeAndDateUtility.GetCurrentTimeString());
            User_Date.SetText(TimeAndDateUtility.GetCurrentDateString());

            Icon = Resources.icon;
            DateTimeIcon.Icon = Resources.icon;

            _delay = new OnDelay();
        }
Esempio n. 7
0
 private void Calendar_DateChanged(object sender, DateRangeEventArgs e)
 {
     EIV.ClearEventInfo();
     EIV.UpdateEvents(EventCal.GetControl().SelectionRange.Start);
     EIV.ToggleButtons();
 }