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:
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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>();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user