Example #1
0
 public BlankEditModel(DomainEntity target)
     : base(target)
 {
 }
Example #2
0
 public EditEntityModel(DomainEntity target)
 {
     SaveButtonText = FastPackKeys.SAVE_KEY;
     Target = target;
     _notification = new Notification();
 }
 public void ApplyDefaultsToNewEntity(DomainEntity entity)
 {
     // nothing
 }
Example #4
0
        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));
        }