Ejemplo n.º 1
0
        private string GetDataType(OrderCriterion orderCriterion)
        {
            if (orderCriterion.DataType == typeof(string))
            {
                if (orderCriterion.Length > 0 && orderCriterion.Length < 4000)
                {
                    return(string.Format("NVARCHAR({0})", orderCriterion.Length));
                }
                else
                {
                    return("NVARCHAR(max)");
                }
            }
            else if (orderCriterion.DataType == typeof(DateTime))
            {
                return("DATETIME");
            }
            else if (orderCriterion.DataType == typeof(Guid))
            {
                return("UNIQUEIDENTIFIER");
            }
            else if (orderCriterion.DataType == typeof(Int64))
            {
                return("BIGINT");
            }
            else if (orderCriterion.DataType == typeof(Int32))
            {
                return("INTEGER");
            }
            else if (orderCriterion.DataType == typeof(Int16))
            {
                return("SMALLINT");
            }
            else if (orderCriterion.DataType == typeof(Decimal))
            {
                return("FLOAT");
            }
            else if (orderCriterion.DataType == typeof(Double))
            {
                return("FLOAT");
            }
            else if (orderCriterion.DataType == typeof(Boolean))
            {
                return("BIT");
            }

            return("NVARCHAR(max)");
        }
Ejemplo n.º 2
0
        public void AddXmlOrder(Type type, Type dataType, Int32 length, string xmlPath, string propertyName, string wtName, string sortOrder)
        {
            OrderCriterion orderCriterion = new OrderCriterion(type, dataType, length, xmlPath, propertyName, wtName, sortOrder, AggregateFunction.None);

            m_OrderCriteriaList.Add(orderCriterion);
        }
Ejemplo n.º 3
0
        public void AddOrder(Type type, string propertyName, string sortOrder, AggregateFunction aggregateFunction)
        {
            OrderCriterion orderCriterion = new OrderCriterion(type, propertyName, sortOrder, aggregateFunction);

            m_OrderCriteriaList.Add(orderCriterion);
        }
Ejemplo n.º 4
0
 public OrderCriterion(OrderCriterion orderCriterion)
 {
     m_OriginalPropertyName = orderCriterion.OriginalPropertyName;
     Initialize(orderCriterion.Type, orderCriterion.DataType, orderCriterion.Length, orderCriterion.XmlPath, orderCriterion.PropertyInfo, orderCriterion.SortOrder, orderCriterion.AggregateFunction);
 }