Esempio n. 1
0
        public void SetValues(SavedEvent @event)
        {
            TitleTB.SetText(@event.Title);
            CommentTB.SetText(@event.Comment ?? string.Empty);
            DateTime now = DateTime.Now;

            DateTime start = TimeAndDateUtility.ConvertDateAndTime_DateTime(@event.ActivationDate);
            DateTime end   = TimeAndDateUtility.ConvertDateAndTime_DateTime(@event.DeactivationDate);

            StartPicker.SetDates(now > start ? start.Date : now.Date, start, DateTime.MaxValue);
            EndPicker.SetDates(now > end ? end.Date : now.Date, end, DateTime.MaxValue);

            if (start < now)
            {
                StartPicker.GetControl().Enabled = false;
            }

            if (end < now)
            {
                EndPicker.GetControl().Enabled = false;
            }

            if (!StartPicker.GetControl().Enabled&& !EndPicker.GetControl().Enabled)
            {
                TitleTB.GetControl().Enabled   = false;
                CommentTB.GetControl().Enabled = false;

                _purpose = CrudPurposes.None;
                SetTitle();
            }
        }
Esempio n. 2
0
 public void SetPurpose(CrudPurposes purpose)
 {
     Data.Results = new SavedEvent();
     Data.Error   = false;
     _purpose     = purpose;
     SetTitle();
 }
Esempio n. 3
0
 public void SetPurpose(CrudPurposes purpose)
 {
     Data.Results = new AppMessage();
     Data.Error   = false;
     _purpose     = purpose;
     SetTitle();
 }
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
        public void CreateView(CrudPurposes purpose, AppMessage message = null)
        {
            if (purpose == CrudPurposes.Error)
            {
                Error.Visible = true;
                MV.Visible    = false;
            }
            else
            {
                Error.Visible = false;
                MV.Visible    = true;
                MV.SetControls(_id, _controls);
                MV.SetPurpose(purpose);
            }

            if (purpose == CrudPurposes.Edit)
            {
                MV.SetValues(message);
            }
        }