Esempio n. 1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the EventTypes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEventTypes(EventType eventType)
 {
     base.AddObject("EventTypes", eventType);
 }
Esempio n. 2
0
        private void AddEventTypeCommandExecuted()
        {
            var type = new EventType
                {
                    ID = Guid.NewGuid(),
                    Name = "New Event Type",
                    Colour = "#808080",
                    PreferredName = "",
                    Abbreviation = ""
                };

            _adminDataUnit.EventTypesRepository.Add(type);
            _adminDataUnit.SaveChanges();

            var typeModel = new EventTypeModel(type);
            LoadEventTypeOptions(typeModel);

            EventTypes.Add(typeModel);

            SelectedObject = typeModel;
        }
Esempio n. 3
0
 /// <summary>
 /// Create a new EventType object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="preferredName">Initial value of the PreferredName property.</param>
 /// <param name="abbreviation">Initial value of the Abbreviation property.</param>
 /// <param name="colour">Initial value of the Colour property.</param>
 /// <param name="isEnabled">Initial value of the IsEnabled property.</param>
 /// <param name="allowToBeBooked">Initial value of the AllowToBeBooked property.</param>
 /// <param name="allowEnquiry">Initial value of the AllowEnquiry property.</param>
 public static EventType CreateEventType(global::System.Guid id, global::System.String name, global::System.String preferredName, global::System.String abbreviation, global::System.String colour, global::System.Boolean isEnabled, global::System.Boolean allowToBeBooked, global::System.Boolean allowEnquiry)
 {
     EventType eventType = new EventType();
     eventType.ID = id;
     eventType.Name = name;
     eventType.PreferredName = preferredName;
     eventType.Abbreviation = abbreviation;
     eventType.Colour = colour;
     eventType.IsEnabled = isEnabled;
     eventType.AllowToBeBooked = allowToBeBooked;
     eventType.AllowEnquiry = allowEnquiry;
     return eventType;
 }
Esempio n. 4
0
        public EventModel(Event @event, bool isFromReports = false, RoundAgeReportFilter filterValue = RoundAgeReportFilter.None, bool isActualEvent = true)
        {
            _event = @event;

            _eventType = _event.EventType;
            _eventStatus = _event.EventStatus;

            EventUpdates = new ObservableCollection<EventUpdate>();
            EventItems = new ObservableCollection<EventItemModel>();
            EventNotes = new ObservableCollection<EventNoteModel>();
            EventCharges = new ObservableCollection<EventChargeModel>();
            EventItemsWithNotes = new ObservableCollection<EventItemModel>();
            EventContacts = new ObservableCollection<EventContact>();
            Correspondences = new ObservableCollection<CorrespondenceModel>();
            Reports = new ObservableCollection<ReportModel>();
            EventReminders = new ObservableCollection<EventReminderModel>();

            if (isFromReports)
            {
                EventPayments = new ObservableCollection<EventPaymentModel>(_event.EventPayments.Select(x => new EventPaymentModel(x)));
                EventCaterings = new List<EventCateringModel>(_event.EventCaterings.Select(x => new EventCateringModel(x)));
                EventGolfs = new List<EventGolfModel>(_event.EventGolfs.Where(eventGolf => !eventGolf.IsLinked).Select(x => new EventGolfModel(x)));
                EventRooms = new List<EventRoomModel>(_event.EventRooms.Select(x => new EventRoomModel(x)));
                EventInvoices = new List<EventInvoiceModel>(_event.EventInvoices.Select(x => new EventInvoiceModel(x)));
                EventBookedProducts = new List<EventBookedProductModel>(_event.EventBookedProducts.Select(x => new EventBookedProductModel(x)));
                EventNotes = new ObservableCollection<EventNoteModel>(_event.EventNotes.Select(x => new EventNoteModel(x)));

                SetEventPriceForReports(filterValue);
                UpdatePaymentDetails();
                Days = DateTime.Now - Event.Date;
            }
            else
            {
                EventPayments = new ObservableCollection<EventPaymentModel>();
                EventCaterings = new List<EventCateringModel>();
                EventRooms = new List<EventRoomModel>();
                EventGolfs = new List<EventGolfModel>();
                EventInvoices = new List<EventInvoiceModel>();
                EventBookedProducts = new List<EventBookedProductModel>();
            }
            Documents = new List<Document>();

            if (_event.Contact != null)
                PrimaryContact = new ContactModel(_event.Contact);

            LoadedTime = DateTime.Now;

            RefreshChanges();

            IsActualEvent = isActualEvent;
            IsGroupDateVisible = true;
        }