Beispiel #1
0
 public BlankEditModel(DomainEntity target)
     : base(target)
 {
 }
Beispiel #2
0
 public EditEntityModel(DomainEntity target)
 {
     SaveButtonText = FastPackKeys.SAVE_KEY;
     Target = target;
     _notification = new Notification();
 }
 public void ApplyDefaultsToNewEntity(DomainEntity entity)
 {
     // nothing
 }
        private ICriteria buildProjection(ISession session, DomainEntity target)
        {
            var criteria = session.CreateCriteria(_targetType);
            _properties.Each(p =>
            {
                var restriction = Restrictions.Eq(p.Name, p.GetValue(target, null));
                if (p.PropertyType == typeof(string))
                {
                    restriction = restriction.IgnoreCase();
                }
                criteria.Add(restriction);
            });

            criteria.Add(Restrictions.Not(Restrictions.Eq(Entity.IdPropertyName, target.As<DomainEntity>().Id)));
            return criteria.SetProjection(Projections.Count(_properties.First().Name));
        }