Ejemplo 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();
        }
Ejemplo n.º 2
0
        internal void RefreshEventSearch()
        {
            SEIV.ClearEventInfo();

            string   searchTerm = SearchTB.Text;
            DateTime start      = UseStartDate.Checked ? DateTime.Parse(SearchStartDP.Date).Date : DateTime.MaxValue;
            DateTime end        = UseEndDate.Checked ?
                                  DateTime.Parse(SearchEndDP.Date).Date.AddHours(23).AddMinutes(59).AddSeconds(59)
                : DateTime.MinValue;

            SEIV.UpdateEvents(start, end, searchTerm);
        }
Ejemplo 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();
            }
        }
Ejemplo n.º 4
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();
        }