private void Show_EventProperties() { //General properties Txt_EventName.Text = oRecordEvent.Name; DP_EventDate.Value = oRecordEvent.StartingDate; rTxt_EventComment.Text = oRecordEvent.Comment; //User info Ctrl_UserInfo.Set_UserInformations(oRecordEvent.UserInfos); //Record sessions Update_SessionList(); }
private bool Set_EventProperties() { if (!(Txt_EventName.Text.Equals(""))) { oRecordEvent.Name = Txt_EventName.Text; } else { MessageBox.Show("Name of the record event cannot be empty !", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(false); } oRecordEvent.StartingDate = DP_EventDate.Value; oRecordEvent.Comment = rTxt_EventComment.Text; //User infos oRecordEvent.UserInfos = Ctrl_UserInfo.Get_UserInformations(); //Record session created in the event on the fly //Update application event list if new event string AppEventsFile = CANStreamTools.CsDataPath + "\\RecordEvents.xml"; CS_RecordEventsCollection oAppEvents = new CS_RecordEventsCollection(); if (File.Exists(AppEventsFile)) { oAppEvents.Read_EventsCollectionFile(AppEventsFile); } if (bNewEvent) { oAppEvents.Events.Insert(0, oRecordEvent); } else { int EventId = oAppEvents.Get_RecordEventIndex(OriginalEventName, OriginalEventDate); if (EventId != -1) { oAppEvents.Events[EventId] = oRecordEvent; } else { oAppEvents.Events.Insert(0, oRecordEvent); } } oAppEvents.Write_EventsCollectionFile(AppEventsFile); return(true); }