2011-01-13 20:21:02 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.Serialization;
|
2014-10-12 09:41:45 +00:00
|
|
|
|
using NHibernate.Mapping.ByCode.Conformist;
|
|
|
|
|
using NHibernate.Mapping.ByCode;
|
2011-01-13 20:21:02 +00:00
|
|
|
|
|
2011-01-30 07:14:05 +00:00
|
|
|
|
namespace Tanshu.Accounts.Entities
|
2011-01-13 20:21:02 +00:00
|
|
|
|
{
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public class PrintLocation
|
2011-01-13 20:21:02 +00:00
|
|
|
|
{
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public virtual Guid PrintLocationID { get; set; }
|
2011-01-31 20:33:22 +00:00
|
|
|
|
public virtual ProductGroup ProductGroup { get; set; }
|
|
|
|
|
public virtual string Location { get; set; }
|
|
|
|
|
public virtual string Printer { get; set; }
|
|
|
|
|
public virtual int Copies { get; set; }
|
|
|
|
|
public virtual string CutCode { get; set; }
|
2014-11-02 08:03:31 +00:00
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return Location.GetHashCode() ^ Printer.GetHashCode() ^ Copies.GetHashCode() ^ CutCode.GetHashCode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static bool operator ==(PrintLocation a, PrintLocation b)
|
|
|
|
|
{
|
|
|
|
|
if (object.ReferenceEquals(null, a))
|
|
|
|
|
return object.ReferenceEquals(null, b);
|
|
|
|
|
|
|
|
|
|
if (!(a is PrintLocation))
|
|
|
|
|
return false;
|
|
|
|
|
if (!(b is PrintLocation))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return a.Location == b.Location && a.Printer == b.Printer && a.Copies == b.Copies && a.CutCode == b.CutCode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static bool operator !=(PrintLocation a, PrintLocation b)
|
|
|
|
|
{
|
|
|
|
|
return !(a == b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Equals(System.Object obj)
|
|
|
|
|
{
|
|
|
|
|
if (obj is PrintLocation)
|
|
|
|
|
return (this == (PrintLocation)obj);
|
|
|
|
|
else
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2014-10-12 09:41:45 +00:00
|
|
|
|
}
|
|
|
|
|
public class PrintLocationMap : ClassMapping<PrintLocation>
|
|
|
|
|
{
|
|
|
|
|
public PrintLocationMap()
|
2011-01-30 07:14:05 +00:00
|
|
|
|
{
|
2014-10-12 09:41:45 +00:00
|
|
|
|
Table("PrintLocations");
|
|
|
|
|
Schema("dbo");
|
|
|
|
|
Lazy(true);
|
|
|
|
|
Id(x => x.PrintLocationID, map => map.Generator(Generators.GuidComb));
|
|
|
|
|
Property(x => x.Location);
|
|
|
|
|
Property(x => x.Printer);
|
|
|
|
|
Property(x => x.Copies);
|
|
|
|
|
Property(x => x.CutCode);
|
|
|
|
|
ManyToOne(x => x.ProductGroup, map =>
|
|
|
|
|
{
|
|
|
|
|
map.Column("ProductGroupID");
|
|
|
|
|
map.Cascade(Cascade.None);
|
|
|
|
|
});
|
2011-01-17 14:55:43 +00:00
|
|
|
|
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
2011-01-13 20:21:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|