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(); } }
public void SetValues(AppMessage message) { TitleTB.SetText(message.Title); QuoteTB.SetText(message.Quote); AuthorTB.SetText(message.Author); SourceTB.SetText(message.Source); if (message.Show) { MessageShowRB.Checked = true; } else { MessageHideRB.Checked = true; } }