private void TypeTextEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (e == null || e.Value == null)
     {
         return;
     }
     try
     {
         e.DisplayText = EventTypeReference.GetEventReference((EventTypes)e.Value);
     }catch (Exception)
     {
     }
 }
 private void SetFormData()
 {
     if (Event == null)
     {
         EventType.EditValue = EventTypeReference.GetEventReference(EventTypes.Unknown);
     }
     else
     {
         EventName.EditValue            = Event.Name;
         EventDescription.EditValue     = Event.Description;
         EventType.EditValue            = EventTypeReference.GetEventReference(Event.Type);
         EventPersonNumber.EditValue    = Event.PersonNumber;
         EventManager.EditValue         = Event.ManagerPersonId;
         EventContactPerson.EditValue   = Event.ContactPersonId;
         EventOrganization.EditValue    = Event.OrganizationId;
         RegistrationDateEdit.EditValue = Event.RegistrationDate;
         ExitDateEdit.EditValue         = Event.ExitDate;
     }
 }