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 SetPurpose(CrudPurposes purpose) { Data.Results = new SavedEvent(); Data.Error = false; _purpose = purpose; SetTitle(); }
public void SetPurpose(CrudPurposes purpose) { Data.Results = new AppMessage(); Data.Error = false; _purpose = purpose; SetTitle(); }
/// <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); } }
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); } }