using DevExpress.Persistent.Base; using DevExpress.Persistent.BaseImpl; using DevExpress.Persistent.Validation; using DevExpress.Xpo; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; namespace DurnyklyYol.Module.BusinessObjects { [DefaultClassOptions, NavigationItem("Transportation")] [ImageName("GeoPointMaps")] [DefaultProperty(nameof(Title))] //[DefaultListViewOptions(MasterDetailMode.ListViewOnly, false, NewItemRowPosition.None)] //[Persistent("DatabaseTableName")] // Specify more UI options using a declarative approach (https://documentation.devexpress.com/#eXpressAppFramework/CustomDocument112701). public class Route : BaseObject { // Inherit from a different class to provide a custom primary key, concurrency and deletion behavior, etc. (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument113146.aspx). // Use CodeRush to create XPO classes and properties with a few keystrokes. // https://docs.devexpress.com/CodeRushForRoslyn/118557 public Route(Session session) : base(session) { } Warehouse destinationPoint; Warehouse startPoint; string title; [Size(SizeAttribute.DefaultStringMappingFieldSize), RuleRequiredField(DefaultContexts.Save)] public string Title { get => title; set => SetPropertyValue(nameof(Title), ref title, value); } [RuleRequiredField(DefaultContexts.Save)] public Warehouse StartPoint { get => startPoint; set => SetPropertyValue(nameof(StartPoint), ref startPoint, value); } [RuleRequiredField(DefaultContexts.Save)] public Warehouse DestinationPoint { get => destinationPoint; set => SetPropertyValue(nameof(DestinationPoint), ref destinationPoint, value); } [Association("Route-RoutePoints"), Aggregated] public XPCollection Points { get { return GetCollection(nameof(Points)); } } } }