当前位置: 首页>>代码示例>>C#>>正文


C# ICriteria.AddOrder方法代码示例

本文整理汇总了C#中ICriteria.AddOrder方法的典型用法代码示例。如果您正苦于以下问题:C# ICriteria.AddOrder方法的具体用法?C# ICriteria.AddOrder怎么用?C# ICriteria.AddOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICriteria的用法示例。


在下文中一共展示了ICriteria.AddOrder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddCriteria

 public ICriteria AddCriteria(ICriteria criteria)
 {
     if (m_order == SortFilter.Orders.ASC)
     {
         return criteria.AddOrder(NHibernate.Criterion.Order.Asc(m_fieldName));
     }
     else
     {
         return criteria.AddOrder(NHibernate.Criterion.Order.Desc(m_fieldName));
     }
 }
开发者ID:Minatron,项目名称:Minatron,代码行数:11,代码来源:SortFilter.cs

示例2: AddOrdersToCriteria

		/// <summary>
		/// Adds a collection of Order (sort by) specifiers to an ICriteria.
		/// </summary>
		/// <param name="criteria">The ICriteria that will be modified.</param>
		/// <param name="orders">The collection of Order specifiers.</param>
		internal static void AddOrdersToCriteria(ICriteria criteria, Order[] orders)
		{
			if (orders != null)
			{
				foreach (Order order in orders)
				{
					criteria.AddOrder(order);
				}
			}
		}
开发者ID:ray2006,项目名称:WCell,代码行数:15,代码来源:CriteriaHelper.cs

示例3: AddCriteriaAndOrder

        /// <summary>
        /// 
        /// </summary>
        /// <param name="hibernateCriteria"></param>
        /// <param name="where"></param>
        /// <param name="orders"></param>
        private void AddCriteriaAndOrder(ICriteria hibernateCriteria, IEnumerable<ICriterion> where, IEnumerable<Order> orders)
        {
            foreach (ICriterion criterion in where)
            {
                hibernateCriteria.Add(criterion);
            }

            foreach (Order order in orders)
            {
                hibernateCriteria.AddOrder(order);
            }
        }
开发者ID:DelLitt,项目名称:opmscoral,代码行数:18,代码来源:ReceiptOutDAOImpl.cs

示例4: AddOrdersToCriteria

 private static void AddOrdersToCriteria(ICriteria criteria, IEnumerable<Order> orders)
 {
     if (orders != null)
     {
         foreach (Order order in orders)
         {
             criteria.AddOrder(order);
         }
     }
 }
开发者ID:stasizb,项目名称:ActiveRecord,代码行数:10,代码来源:ActiveRecordBase.cs

示例5: GetOrder

        private static void GetOrder(Sort sort, ICriteria cr)
        {
            bool sortDir = sort.Direction == "ASC" ? true : false;
            Order order = null;

            if (sort.Column.IndexOf(".", StringComparison.OrdinalIgnoreCase) >= 0)
                order = new Order(sort.Column, sortDir);

            else
                order = new Order(string.Format("attendance.{0}", sort.Column), sortDir);

            cr.AddOrder(order);
        }
开发者ID:kenny007,项目名称:Payroll_MVC4,代码行数:13,代码来源:AttendanceHelper.cs

示例6: GetOrder

 private static void GetOrder(Sort sort, ICriteria cr)
 {
     bool sortDir = sort.Direction == "ASC" ? true : false;
     Order order = new Order(string.Format("dept.{0}", sort.Column), sortDir);
     cr.AddOrder(order);
 }
开发者ID:kenny007,项目名称:Payroll_MVC4,代码行数:6,代码来源:DepartmentHelper.cs

示例7: setOrderBy

 public void setOrderBy(ref ICriteria icr)
 {
     icr.AddOrder(new Order("recInd", false));
     icr.AddOrder(new Order("recLevel", false));
     icr.AddOrder((new Order("hotelName",true)));
 }
开发者ID:uhealin,项目名称:toyz-toyz4net,代码行数:6,代码来源:HotelModel.cs

示例8: OrderComplexSearch

 public static ICriteria OrderComplexSearch(IList<OrderCriteria> critList, ICriteria c)
 {
     foreach (OrderCriteria s in critList)
     {
         switch (s.Order)
         {
             case OrderType.ASC:
                 c.AddOrder(Order.Asc(s.PropertyName));
                 break;
             case OrderType.DESC:
                 c.AddOrder(Order.Desc(s.PropertyName));
                 break;
         }
     }
     return c;
 }
开发者ID:BobPalmer,项目名称:Dormouse.Core,代码行数:16,代码来源:Utilities.cs

示例9: AddTimeOrdering

 private static void AddTimeOrdering(ICriteria criteria)
 {
     criteria.AddOrder(Order.Asc("Year"));
     criteria.AddOrder(Order.Asc("Quarter"));
     criteria.AddOrder(Order.Asc("Month"));
 }
开发者ID:PublicHealthEngland,项目名称:fingertips-open,代码行数:6,代码来源:TrendDataReader.cs

示例10: setOrderby

 protected void setOrderby(ref ICriteria icr)
 {
     string orderbyName = WebUtil.GetParamAttr("orderbyName",null);
     if (orderbyName == null) return;
     string orderbyType = WebUtil.GetParamAttr("orderbyType", "desc");
     if (orderbyType == "desc") {
         icr.AddOrder(Order.Desc(orderbyName));
     }
     else if (orderbyType == "asc")
     {
         icr.AddOrder(Order.Asc(orderbyName));
     }
     else {
         icr.AddOrder(Order.Desc(orderbyName));
     }
 }
开发者ID:uhealin,项目名称:toyz-toyz4net,代码行数:16,代码来源:BaseZdController.cs

示例11: setOrderBy

 public void setOrderBy(ref ICriteria icr)
 {
     icr.AddOrder(Order.Desc("recInd"));
     icr.AddOrder(Order.Desc("recLevel"));
     icr.AddOrder(Order.Desc("picURL"));
     icr.AddOrder(Order.Desc("brandName"));
 }
开发者ID:uhealin,项目名称:toyz-toyz4net,代码行数:7,代码来源:BrandModel.cs

示例12: OnEvent

 public void OnEvent(ICriteria crit)
 {
     crit.AddOrder(order);
 }
开发者ID:spib,项目名称:nhcontrib,代码行数:4,代码来源:AddOrderEvent.cs

示例13: Get_OnCriteria

 public void Get_OnCriteria(object sender, ICriteria criteria)
 {
     criteria.AddOrder(Order.Asc("Code"));
     //            ICriterion criterion = Restrictions.Eq("Name", "测试123");
     //            criteria.Add(criterion);
 }
开发者ID:linyuxiangfly,项目名称:EasyJob,代码行数:6,代码来源:EmployeeController.cs

示例14: setOrderBy

 public void setOrderBy(ref ICriteria icr)
 {
     icr.AddOrder(Order.Desc("id"));
 }
开发者ID:uhealin,项目名称:toyz-toyz4net,代码行数:4,代码来源:OrderModel.cs

示例15: InitSession

 /// <summary>
 /// Initializes the session that will be used to enumerate
 /// </summary>
 private void InitSession()
 {
     _session = _sessionFactory.OpenSession();
     _session.FlushMode = FlushMode.Never;
     _tx = _session.BeginTransaction();
     try
     {
         //Handle the case of entity type (InitialLoad)
         if (_entityType != null)
         {
             _criteria = _session.CreateCriteria(_entityType);
             _criteria.SetCacheable(false);
             //If perform by id, add order to the criteria
             if (_performOrderById)
             {
                 IClassMetadata metadata = _sessionFactory.GetClassMetadata(_entityType);
                 string idPropName = metadata.IdentifierPropertyName;
                 if (idPropName != null)
                     _criteria.AddOrder(Order.Asc(idPropName));
             }
         }
         //Handle the case of Persistency.Query (GetEnumerator)
         else if (_persistencyQuery != null)
         {
             string select = _persistencyQuery.SqlQuery;
             _query = _session.CreateQuery(select);
             object[] preparedValues = _persistencyQuery.Parameters;
             if (preparedValues != null)
             {
                 for (int i = 0; i < preparedValues.Length; i++)
                 {
                     _query.SetParameter(i, preparedValues[i]);
                 }
             }
             _query.SetCacheable(false);
             _query.SetFlushMode(FlushMode.Never);
         }
         else throw new Exception("NHibernateDataEnumerator must receive an Entity Type or a Query");
     }
     catch(Exception ex)
     {
         if (_tx != null && _tx.IsActive)
             _tx.Rollback();
         if (_session.IsOpen)
             _session.Close();
         throw new Exception("Error while constructing an enumerator", ex);
     }
 }
开发者ID:GigaSpaces-ProfessionalServices,项目名称:xapnet-templates,代码行数:51,代码来源:NHibernateDataEnumerator.cs


注:本文中的ICriteria.AddOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。