|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using Technewlogic.ObjectLounge.Framework.Proxy;
using Technewlogic.ObjectLounge.Framework.Validation;
namespace Technewlogic.ObjectLounge.Test.Model
{
[Identity("_key")]
public class Order : BOBase
{
#region Constants
public const string NewID = "New Order";
public const string CmmsID = "CmmsOrder";
public const string TimeFliesID = "TimeFliesOrder";
public const string BillingSystemID = "BillingSystemOrder";
#endregion
public Order()
{
}
public Guid _key = Guid.NewGuid();
public string _orderID;
public virtual string OrderID
{
get
{
return _orderID;
}
set
{
_orderID = value;
SendPropertyChanged("OrderID");
}
}
public float _price;
public virtual float Price
{
get
{
return _price;
}
set
{
_price = value;
SendPropertyChanged("Price");
}
}
public DateTime _shippingDate;
public virtual DateTime ShippingDate
{
get
{
return _shippingDate;
}
set
{
_shippingDate = value;
SendPropertyChanged("ShippingDate");
}
}
[Composition]
public virtual IList<Material> Materials { get; protected set; }
// IMP: Vielleicht besser abstract machen, so dass die Implementierung gar nicht vorkommt? Oder AutomaticProperties?
//protected virtual MasterRef<Customer> _customer { get; set; }
[MasterRef]
public virtual Customer Customer
{
//get { return _customer.Value; }
get { throw new NotImplementedException(); }
}
//protected AggregateLink<OrderType> _orderType { get; set; }
[Aggregation]
public virtual OrderType OrderType
{
//get { return _orderType.Value; }
get { throw new NotImplementedException(); }
//set { _orderType.Value = value; }
set { }
}
#region Validation
[ValidationRule]
protected ValidationResult ValidatePrice()
{
if (Context.EnableValidation)
return ValidationResult.Failure("Price too low!!!");
return ValidationResult.Success();
}
#endregion
public override string ToString()
{
return this.GetType().Name + ": " + OrderID;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.