Esempio n. 1
0
        public static ObjectCategory FindByCode(Context context, string treeListNodeCode, Type type)
        {
            ICriteria    crit = context.PersistenceSession.CreateCriteria(typeof(ObjectCategory));
            TreeListNode node = TreeListNode.FindByCode(context, treeListNodeCode);

            crit.Add(Expression.Eq("Pk.Category", node));
            crit.Add(Expression.Eq("Pk.Discriminator", getDiscriminatorByType(type)));
            return(crit.UniqueResult <ObjectCategory>());
        }
Esempio n. 2
0
        //xxx
        public static IList <TimeSchedule> Find(Context context, string keyWord)
        {
            ICriteria    crit     = context.PersistenceSession.CreateCriteria <TimeSchedule>();
            TreeListNode category = TreeListNode.FindByCode(context, "MFAccountSchedule");

            crit.Add(Expression.Eq("Category", category));

            crit.CreateAlias("Title", "title");

            //crit.Add(Expression.Like("title", ""));
            return(crit.List <TimeSchedule>());
        }