Finally Deployed. Don't know the total amount of changes.

This commit is contained in:
tanshu
2014-11-06 16:09:11 +05:30
parent dc3576437f
commit 948cd0bf28
34 changed files with 389 additions and 990 deletions

View File

@ -1,14 +0,0 @@
using System;
using System.Runtime.Serialization;
namespace Tanshu.Accounts.Contracts
{
public class ProductDisplaySmall
{
public virtual int Code { get; set; }
public virtual string Name { get; set; }
public virtual decimal Price { get; set; }
public virtual string Category { get; set; }
public virtual int ProductID { get; set; }
}
}

View File

@ -20,7 +20,7 @@ namespace Tanshu.Accounts.Contracts
{
public virtual DateTime Date { get; set; }
public virtual string BillID { get; set; }
public virtual string Settlement { get; set; }
public virtual decimal Amount { get; set; }
public virtual string Settlement { get; set; }
}
}

View File

@ -17,7 +17,8 @@ namespace Tanshu.Accounts.Entities
}
public virtual Guid KotID { get; set; }
public virtual Voucher Voucher { get; set; }
public virtual int Code { get; set; }
protected int _code;
public virtual int Code { get { return _code; } }
public virtual FoodTable Table { get; set; }
public virtual bool Printed { get; set; }
public virtual DateTime Date { get; set; }
@ -39,6 +40,7 @@ namespace Tanshu.Accounts.Entities
map.NotNullable(true);
map.Unique(true);
map.Generated(PropertyGeneration.Insert);
map.Access(Accessor.NoSetter);
});
Property(x => x.Printed, map => map.NotNullable(true));
Property(x => x.Date, map =>

View File

@ -9,7 +9,8 @@ namespace Tanshu.Accounts.Entities
{
public virtual Guid ReprintID { get; set; }
public virtual User User { get; set; }
public virtual DateTime Date { get; set; }
protected DateTime _date;
public virtual DateTime Date { get { return _date; } }
public virtual Voucher Voucher { get; set; }
}
public class ReprintMap : ClassMapping<Reprint>
@ -26,6 +27,7 @@ namespace Tanshu.Accounts.Entities
{
map.NotNullable(true);
map.Generated(PropertyGeneration.Insert);
map.Access(Accessor.NoSetter);
});
ManyToOne(x => x.User, map =>
{

View File

@ -4,25 +4,25 @@ namespace Tanshu.Accounts.Entities
{
public enum SettleOption
{
[Display("Unsettled", false, 1)]
[Display("Unsettled", false, 1, true)]
Unsettled = 1,
[Display("Cash", true, 2)]
[Display("Cash", true, 2, false)]
Cash = 2,
[Display("Credit Card", true, 2)]
[Display("Credit Card", true, 2, true)]
CreditCard = 3,
[Display("No Charge", true, 3)]
[Display("No Charge", true, 3, true)]
NoCharge = 4,
[Display("Bill To Company", true, 2)]
[Display("Bill To Company", true, 2, true)]
BillToCompany = 5,
[Display("Tip", true, 2)]
[Display("Tip", true, 2, true)]
Tip = 6,
[Display("Round Off", false, 1)]
[Display("Round Off", false, 1, false)]
RoundOff = 7,
[Display("Amount", false, 1)]
[Display("Amount", false, 1, false)]
Amount = 8,
[Display("Settled", false, 1)]
Settled = 9,
[Display("Staff",true,4)]
[Display("Void", false, 1, true)]
Void = 9,
[Display("Staff", true, 4, true)]
Staff = 10
}
}

View File

@ -18,7 +18,6 @@ namespace Tanshu.Accounts.Entities
public Voucher(User user)
: this()
{
this.Date = null;
this.User = user;
VoucherType = VoucherType.Regular;
}
@ -37,13 +36,17 @@ namespace Tanshu.Accounts.Entities
public virtual Guid VoucherID { get; set; }
public virtual DateTime? Date { get; set; }
protected DateTime _date;
public virtual DateTime Date { get { return _date; } }
public virtual int Pax { get; set; }
public virtual User User { get; set; }
public virtual DateTime CreationDate { get; set; }
public virtual DateTime LastEditDate { get; set; }
public virtual int? BillID { get; set; }
protected DateTime _creationDate;
public virtual DateTime CreationDate { get { return _creationDate; } }
protected DateTime _lastEditDate;
public virtual DateTime LastEditDate { get { return _lastEditDate; } }
protected int? _billID;
public virtual int? BillID { get { return _billID; } }
public virtual FoodTable Table { get; set; }
public virtual Waiter Waiter { get; set; }
public virtual Customer Customer { get; set; }
@ -53,9 +56,35 @@ namespace Tanshu.Accounts.Entities
public virtual string VoidReason { get; set; }
public virtual bool Printed { get; set; }
public virtual VoucherType VoucherType { get; set; }
public virtual int KotID { get; set; }
protected int _kotID;
public virtual int KotID { get { return _kotID; } }
public virtual IList<Kot> Kots { get; set; }
public virtual IList<Reprint> Reprints { get; set; }
public virtual string FullBillID
{
get
{
if (BillID.HasValue)
{
switch (VoucherType)
{
case VoucherType.NoCharge:
return "NC-" + BillID.Value.ToString();
case VoucherType.Staff:
return "ST-" + BillID.Value.ToString();
case VoucherType.TakeAway:
case VoucherType.Regular:
default:
return (BillID.Value / 10000).ToString() + "-" + (BillID.Value % 10000).ToString();
break;
}
}
else
{
return "K-" + KotID.ToString();
}
}
}
}
public class VoucherMap : ClassMapping<Voucher>
@ -72,21 +101,33 @@ namespace Tanshu.Accounts.Entities
{
map.NotNullable(true);
map.Generated(PropertyGeneration.Always);
map.Access(Accessor.NoSetter);
});
Property(x => x.Pax);
Property(x => x.VoucherType, map => map.NotNullable(true));
Property(x => x.VoucherType, map =>
{
map.NotNullable(true);
map.UniqueKey("UQ_BillID_VoucherType");
});
Property(x => x.Narration);
Property(x => x.CreationDate, map =>
{
map.NotNullable(true);
map.Generated(PropertyGeneration.Insert);
map.Access(Accessor.NoSetter);
});
Property(x => x.LastEditDate, map =>
{
map.NotNullable(true);
map.Generated(PropertyGeneration.Always);
map.Access(Accessor.NoSetter);
});
Property(x => x.BillID, map =>
{
map.Generated(PropertyGeneration.Always);
map.Access(Accessor.NoSetter);
map.UniqueKey("UQ_BillID_VoucherType");
});
Property(x => x.BillID, map => map.Generated(PropertyGeneration.Always));
Property(x => x.Void, map => map.NotNullable(true));
Property(x => x.VoidReason);
Property(x => x.Printed, map => map.NotNullable(true));
@ -94,6 +135,7 @@ namespace Tanshu.Accounts.Entities
{
map.NotNullable(true);
map.Generated(PropertyGeneration.Insert);
map.Access(Accessor.NoSetter);
});
ManyToOne(x => x.User, map =>
{

View File

@ -12,8 +12,15 @@ namespace Tanshu.Accounts.Contracts
Group = group;
}
public string Name { get; set; }
public int Group { get; set; }
public bool ShowInChoices { get; set; }
public DisplayAttribute(string name, bool showInChoices, int group, bool print)
: this(name, showInChoices, group)
{
Print = print;
}
public string Name { get; private set; }
public int Group { get; private set; }
public bool ShowInChoices { get; private set; }
public bool Print { get; private set; }
}
}

View File

@ -10,6 +10,11 @@ namespace Tanshu.Common.Helpers
var attribute = (DisplayAttribute)settleOption.GetType().GetField(settleOption.ToString()).GetCustomAttributes(typeof(DisplayAttribute), false)[0];
return attribute != null ? attribute.Name : "";
}
public static bool Print(this SettleOption settleOption)
{
var attribute = (DisplayAttribute)settleOption.GetType().GetField(settleOption.ToString()).GetCustomAttributes(typeof(DisplayAttribute), false)[0];
return attribute != null ? attribute.Print : false;
}
public static bool Visible(this SettleOption settleOption)
{
var attribute = (DisplayAttribute)settleOption.GetType().GetField(settleOption.ToString()).GetCustomAttributes(typeof(DisplayAttribute), false)[0];

View File

@ -70,9 +70,6 @@
<Compile Include="Data Contracts Display\BillItemKey.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Data Contracts Display\ProductDisplaySmallBO.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Data Contracts\Auth\UserGroup.cs" />
<Compile Include="Data Contracts\Auth\RoleGroup.cs" />
<Compile Include="Data Contracts\Auth\Group.cs" />