Reprint and Printed bill editing logged.

Printed bill can no longer be changed, any changes voids the bill and prints a new one.
Added option to Split Bill.
Kot printed with right time.
Numerous bug fixes.
This commit is contained in:
unknown
2011-08-23 12:40:05 +05:30
parent 226cc30057
commit 831ec37cda
28 changed files with 625 additions and 286 deletions

View File

@ -0,0 +1,36 @@
using System;
using System.Reflection;
using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.Inspections;
using FluentNHibernate.Conventions.Instances;
namespace Tanshu.Accounts.Conventions
{
public class PropertyAccessConvention : IPropertyConvention
{
public void Apply(IPropertyInstance instance)
{
var entityType = instance.EntityType;
var camelCaseUnderscoreName = ConvertToCamelCaseUnderscore(instance.Name);
// Default is to use property setter, so only modify mapping
// if there is a backing field
if (HasField(entityType, camelCaseUnderscoreName))
instance.Access.CamelCaseField(CamelCasePrefix.Underscore);
}
private static string ConvertToCamelCaseUnderscore(string propertyName)
{
return "_" + propertyName[0].ToString().ToLower() + propertyName.Substring(1);
}
private static bool HasField(Type type, string fieldName)
{
var backingField = type.GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance);
return backingField != null;
}
}
}

View File

@ -59,7 +59,7 @@ namespace Tanshu.Accounts.Repository
c.Add<NotNullConvention>();
c.Add<FormulaConvention>();
c.Add<InverseConvention>();
//c.Add<AllowNullConvention>();
c.Add<PropertyAccessConvention>();
c.Add<EnumConvention>();
});