Breaking Changes. Upgrade Script in Sql directory. Deployed

This commit is contained in:
unknown
2011-02-18 22:24:48 +05:30
parent d4cfa92848
commit 9ed5843dbd
86 changed files with 2616 additions and 2358 deletions

View File

@ -2,6 +2,7 @@
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using Tanshu.Accounts.Entities.Auth;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities
{
@ -10,6 +11,7 @@ namespace Tanshu.Accounts.Entities
public virtual int AdvanceID { get; private set; }
public virtual decimal Amount { get; set; }
public virtual string Narration { get; set; }
[NotNull]
public virtual User CashierIn { get; set; }
public virtual DateTime DateIn { get; set; }
public virtual User CashierOut { get; set; }

View File

@ -2,12 +2,14 @@
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities.Auth
{
public class Group
{
public virtual int GroupID { get; set; }
[NotNull, Unique]
public virtual string Name { get; set; }
public virtual IList<RoleGroup> RoleGroups { get; set; }
public virtual IList<UserGroup> UserGroups { get; set; }

View File

@ -2,12 +2,14 @@
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities.Auth
{
public class Role
{
public virtual int RoleID { get; set; }
[NotNull, Unique]
public virtual string Name { get; set; }
public virtual IList<RoleGroup> Groups { get; set; }

View File

@ -1,13 +1,16 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities.Auth
{
public class RoleGroup
{
public virtual int RoleGroupID { get; set; }
[NotNull]
public virtual Role Role { get; set; }
[NotNull]
public virtual Group Group { get; set; }
}
}

View File

@ -2,14 +2,19 @@
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities.Auth
{
public class User
{
public virtual int UserID { get; set; }
[Unique] [NotNull]
public virtual string Name { get; set; }
public virtual string MsrString { get; set; }
[NotNull]
public virtual string Password { get; set; }
[NotNull]
public virtual bool LockedOut { get; set; }
public virtual IList<UserGroup> UserGroups { get; set; }
public User()

View File

@ -1,13 +1,16 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities.Auth
{
public class UserGroup
{
public virtual int UserGroupID { get; set; }
[NotNull]
public virtual User User { get; set; }
[NotNull]
public virtual Group Group { get; set; }
}
}

View File

@ -9,5 +9,7 @@ namespace Tanshu.Accounts.Entities
public virtual int FoodTableID { get; set; }
public virtual string Name { get; set; }
public virtual string Location { get; set; }
public virtual string Status { get; set; }
public virtual int VoucherID { get; set; }
}
}

View File

@ -9,39 +9,27 @@ namespace Tanshu.Accounts.Entities
public class Inventory
{
public virtual int InventoryID { get; set; }
public virtual Voucher Voucher { get; set; }
[NotNull]
public virtual Kot Kot { get; set; }
[NotNull]
public virtual Product Product { get; set; }
public virtual decimal Quantity { get; set; }
public virtual decimal Rate { get; set; }
public virtual decimal Tax { get; set; }
public virtual decimal Discount { get; set; }
public virtual decimal ServiceCharge { get; set;}
public virtual decimal ServiceCharge { get; set; }
[Cascade]
public virtual IList<InventoryModifier> InventoryModifier { get; set; }
[Formula(Formula = "Quantity * Rate * (1 - Discount) * (1 + ServiceCharge) * (1 + Tax)")]
public virtual decimal Amount
{
get
{
return Quantity * Rate * (1 + Tax) * (1 + ServiceCharge) * (1 - Discount);
}
set
{ }
private set { }
}
//public decimal DiscountAmount
//{
// get
// {
// return quantity * rate * (1 + tax) * (1 + serviceCharge) * discount;
// }
//}
public Inventory()
{
InventoryModifier = new List<InventoryModifier>();

View File

@ -8,7 +8,9 @@ namespace Tanshu.Accounts.Entities
public class InventoryModifier
{
public virtual int InventoryModifierID { get; set; }
[NotNull]
public virtual Inventory Inventory { get; set; }
[NotNull]
public virtual Modifier Modifier { get; set; }
}
}

View File

@ -0,0 +1,28 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using Tanshu.Accounts.Entities.Auth;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities
{
public class Kot
{
public virtual int KotID { get; set; }
public virtual Voucher Voucher { get; set; }
public virtual string Code { get; set; }
public virtual string TableID { get; set; }
public virtual bool Printed { get; set; }
public virtual DateTime Date { get; set; }
[NotNull]
public virtual User User { get; set; }
[Cascade]
public virtual IList<Inventory> Inventories { get; set; }
public Kot()
{
Inventories = new List<Inventory>();
Printed = false;
}
}
}

View File

@ -2,6 +2,7 @@
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using Tanshu.Accounts.Entities.Auth;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities
{
@ -10,6 +11,7 @@ namespace Tanshu.Accounts.Entities
public virtual int PaymentID { get; set; }
public virtual DateTime Date { get; set; }
public virtual string Type { get; set; }
[NotNull]
public virtual User Cashier { get; set; }
public virtual decimal Amount { get; set; }
public virtual string Narration { get; set; }

View File

@ -1,6 +1,7 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities
{
@ -8,9 +9,12 @@ namespace Tanshu.Accounts.Entities
{
public virtual int ProductID { get; set; }
public virtual int Code { get; set; }
[NotNull]
public virtual string Name { get; set; }
public virtual string Units { get; set; }
[NotNull]
public virtual ProductGroup ProductGroup { get; set; }
[NotNull]
public virtual Tax Tax { get; set; }
public virtual decimal ServiceCharge { get; set; }
public virtual decimal SalePrice { get; set; }

View File

@ -2,12 +2,14 @@
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities
{
public class ProductGroup
{
public virtual int ProductGroupID { get; set; }
[NotNull, Unique]
public virtual string Name { get; set; }
public virtual decimal DiscountLimit { get; set; }
public virtual bool IsModifierCompulsory { get; set; }

View File

@ -1,6 +1,7 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities
{
@ -8,6 +9,7 @@ namespace Tanshu.Accounts.Entities
{
public virtual int ProductGroupModifierID { get; set; }
public virtual ProductGroup ProductGroup { get; set; }
[NotNull]
public virtual Modifier Modifier { get; set; }
public virtual bool ShowAutomatically { get; set; }
}

View File

@ -1,22 +0,0 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities
{
public class SaleVoucher : Voucher
{
public virtual string BillID { get; set; }
public virtual string TableID { get; set; }
public virtual Waiter Waiter { get; set; }
public virtual Customer Customer { get; set; }
public virtual SettleOption Settled { get; set; }
public virtual bool Void { get; set; }
[AllowNull]
public virtual string VoidReason { get; set; }
public virtual bool Printed { get; set; }
public virtual string KotID { get; set; }
public virtual PaymentGroup PaymentGroup { get; set; }
}
}

View File

@ -5,64 +5,13 @@ using System.Text;
namespace Tanshu.Accounts.Entities
{
public class SettleOption
public enum SettleOption
{
public virtual int SettleOptionID { get; set; }
public virtual string Name { get; set; }
public override bool Equals(System.Object obj)
{
if (obj is SettleOption)
return (this == (SettleOption)obj);
else
return false;
}
public override int GetHashCode()
{
return SettleOptionID.GetHashCode() ^ Name.GetHashCode();
}
public static bool operator ==(SettleOption a, SettleOption b)
{
if (object.ReferenceEquals(null, a))
return object.ReferenceEquals(null, b);
if (!(a is SettleOption))
return false;
if (!(b is SettleOption))
return false;
return (a.SettleOptionID == b.SettleOptionID)
&& (a.Name == b.Name);
}
public static bool operator !=(SettleOption a, SettleOption b)
{
return !(a == b);
}
//public enum SettleOption
//{
// Unsettled = 0,
// Cash = 1,
// CreditCard = 2,
// NoCharge = 3,
// BillToCompany = 4,
// Staff = 5
//}
//public class SettleOption
//{
// public static readonly SettleOption Unsettled = new SettleOption(0);
// public static readonly SettleOption Cash = new SettleOption(1);
// public static readonly SettleOption CreditCard = new SettleOption(2);
// public static readonly SettleOption NoCharge = new SettleOption(3);
// public static readonly SettleOption BillToCompany = new SettleOption(4);
// public static readonly SettleOption Staff = new SettleOption(5);
// public int SettleOptionID { get; private set; }
// private SettleOption(int settleOption)
// {
// this.SettleOptionID = settleOption;
// }
//}
Unsettled = 1,
Cash = 2,
CreditCard = 3,
NoCharge = 4,
BillToCompany = 5,
Staff = 6
}
}

View File

@ -1,12 +1,14 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities
{
public class Tax
{
public virtual int TaxID { get; set; }
[NotNull, Unique]
public virtual string Name { get; set; }
public virtual decimal Rate { get; set; }
}

View File

@ -10,19 +10,37 @@ namespace Tanshu.Accounts.Entities
public class Voucher
{
public virtual int VoucherID { get; set; }
public virtual int Code { get; set; }
public virtual string Ref { get; set; }
public virtual DateTime? Date { get; set; }
public virtual string Narration { get; set; }
[NotNull]
public virtual User User { get; set; }
[NotNull]
public virtual DateTime CreationDate { get; set; }
[NotNull]
public virtual DateTime LastEditDate { get; set; }
public virtual char Type { get; set; }
[NotNull]
public virtual string BillID { get; set; }
[NotNull]
public virtual string TableID { get; set; }
[NotNull]
public virtual Waiter Waiter { get; set; }
[NotNull]
public virtual Customer Customer { get; set; }
[NotNull]
public virtual SettleOption Settled { get; set; }
[NotNull]
public virtual bool Void { get; set; }
[AllowNull]
public virtual string VoidReason { get; set; }
[NotNull]
public virtual bool Printed { get; set; }
[NotNull]
public virtual string KotID { get; set; }
[Cascade]
public virtual IList<Inventory> Inventories { get; set; }
public virtual IList<Kot> Kots { get; set; }
public Voucher()
{
Inventories = new List<Inventory>();
this.Kots = new List<Kot>();
}
}
}

View File

@ -1,12 +1,14 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities
{
public class Waiter
{
public virtual int WaiterID { get; set; }
[NotNull, Unique]
public virtual string Name { get; set; }
}
}