86 lines
2.7 KiB
C#
86 lines
2.7 KiB
C#
using DevExpress.Data.Filtering;
|
|
using DevExpress.ExpressApp;
|
|
using DevExpress.ExpressApp.DC;
|
|
using DevExpress.ExpressApp.Model;
|
|
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("Gauges")]
|
|
[DefaultProperty(nameof(Name)), FriendlyKeyProperty(nameof(Number))]
|
|
//[DefaultListViewOptions(MasterDetailMode.ListViewOnly, false, NewItemRowPosition.None)]
|
|
//[Persistent("DatabaseTableName")]
|
|
// Specify more UI options using a declarative approach (https://documentation.devexpress.com/#eXpressAppFramework/CustomDocument112701).
|
|
public class Carrier : 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 Carrier(Session session)
|
|
: base(session)
|
|
{
|
|
}
|
|
|
|
|
|
string phone;
|
|
uint weight;
|
|
string notes;
|
|
string driver;
|
|
string number;
|
|
string name;
|
|
|
|
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
|
|
public string Name
|
|
{
|
|
get => name;
|
|
set => SetPropertyValue(nameof(Name), ref name, value);
|
|
}
|
|
|
|
|
|
[Size(SizeAttribute.DefaultStringMappingFieldSize), RuleRequiredField(DefaultContexts.Save)]
|
|
public string Number
|
|
{
|
|
get => number;
|
|
set => SetPropertyValue(nameof(Number), ref number, value);
|
|
}
|
|
|
|
|
|
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
|
|
public string Driver
|
|
{
|
|
get => driver;
|
|
set => SetPropertyValue(nameof(Driver), ref driver, value);
|
|
}
|
|
|
|
|
|
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
|
|
public string Phone
|
|
{
|
|
get => phone;
|
|
set => SetPropertyValue(nameof(Phone), ref phone, value);
|
|
}
|
|
|
|
[ModelDefault("DisplayFormat", "{0:n2} kg")]
|
|
public uint Weight
|
|
{
|
|
get => weight;
|
|
set => SetPropertyValue(nameof(Weight), ref weight, value);
|
|
}
|
|
|
|
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
|
|
public string Notes
|
|
{
|
|
get => notes;
|
|
set => SetPropertyValue(nameof(Notes), ref notes, value);
|
|
}
|
|
|
|
}
|
|
} |