Regression: BillItemKey added the compare methods back

Regression: PrintLocation added the compare methods back
Breaking: Kot.Code is now integers
Breaking: Kot Update is now via Stored Procedure to get DB Values
Breaking: Reprints Insert is now via Stored Procedure to get DV Values
Breaking: Voucher.BillID and KotID are now integers
Breaking: Voucher Insert/Update is now via Stored Procedures to get DV Values also Dirty Checking for Voucher has been overwritten to set dirty for LastEditDate update
Fix: Login forms simplified
Feature: PrintLocation and Products are cached application wide.
This commit is contained in:
tanshu
2014-11-02 13:33:31 +05:30
parent 45831e2e4d
commit 3ca8b29e04
33 changed files with 528 additions and 332 deletions

View File

@ -156,7 +156,7 @@ namespace Tanshu.Accounts.Contracts
Product = null;
ProductID = kot.KotID;
Discount = 0;
Name = string.Format("Kot: {0} / {1:dd-MMM HH:mm} ({2})", kot.Code, kot.Date, kot.User.Name);
Name = string.Format("Kot: S-{0} / {1:dd-MMM HH:mm} ({2})", kot.Code, kot.Date, kot.User.Name);
Price = 0;
FullPrice = 0;
Printed = true;

View File

@ -5,9 +5,7 @@ namespace Tanshu.Accounts.Contracts
public enum BillItemType
{
Product,
Kot,
Information,
Total
Kot
}
public class BillItemKey
{
@ -34,5 +32,38 @@ namespace Tanshu.Accounts.Contracts
public Guid KotID { get; private set; }
public BillItemType BillItemType { get; private set; }
public override int GetHashCode()
{
return BillItemType.GetHashCode() ^ KotID.GetHashCode() ^ ProductID.GetHashCode();
}
public static bool operator ==(BillItemKey a, BillItemKey b)
{
if (object.ReferenceEquals(null, a))
return object.ReferenceEquals(null, b);
if (!(a is BillItemKey))
return false;
if (!(b is BillItemKey))
return false;
if (a.BillItemType != b.BillItemType)
return false;
return a.KotID == b.KotID && a.BillItemType == b.BillItemType && a.ProductID == b.ProductID;
}
public static bool operator !=(BillItemKey a, BillItemKey b)
{
return !(a == b);
}
public override bool Equals(object obj)
{
if (obj is BillItemKey)
return (this == (BillItemKey)obj);
else
return false;
}
}
}