public void SortWith(InventoryPropertyName sortPropertyName, SortOrder order)
 {
     SortParameters = new SortParameters
     {
         PropertyName = sortPropertyName,
         SortOrder    = order
     };
 }
Ejemplo n.º 2
0
        public void SetPropertyValue(InventoryPropertyName property, object value)
        {
            switch (property)
            {
            case InventoryPropertyName.StockNo:
            {
                if (value != null)
                {
                    string stockNo = ((Int32)value).ToString(CultureInfo.InvariantCulture);
                    _properties[property] = stockNo;
                }
                else
                {
                    _properties[property] = string.Empty;
                }
            }
            break;

            case InventoryPropertyName.Price:
            {
                //because the type of Price in SAP side is string, but the definition here is decimal.
                //TODO: this is just a workaround, need to sync with SAP.
                var price = value as string;
                if (!string.IsNullOrEmpty(price))
                {
                    // remove $ mark from SAP
                    _properties[property] = Decimal.Parse(price.TrimStart('$'));
                }
                else
                {
                    _properties[property] = Decimal.Zero;
                }
                break;
            }

            case InventoryPropertyName.Images:
            {
                throw new NotImplementedException();
            }

            default:
            {
                _properties[property] = value;
                break;
            }
            }
        }
Ejemplo n.º 3
0
 public static IQueryFilterExpression ValueLikes(this InventoryPropertyName propertyName, string lookupValue)
 {
     return(new QueryFilterExpressionLikes(propertyName, lookupValue));
 }
Ejemplo n.º 4
0
 public static IQueryFilterExpression ValueEquals(this InventoryPropertyName propertyName, int value)
 {
     return(new QueryFilterExpressionEquals(propertyName, value.ToString()));
 }
 public SchemaInfo(InventoryPropertyName propertyName, Type columnType, string columnName)
 {
     PropertyName = propertyName;
     ColumnType   = columnType;
     ColumnName   = columnName;
 }
 private static SchemaInfo GetSchemaInfo(this InventoryPropertyName propertyName)
 {
     return(AllSchemaInfos.Single(schemaInfo => schemaInfo.PropertyName == propertyName));
 }
 private static string GetColumnName(this InventoryPropertyName propertyName)
 {
     return(propertyName.GetSchemaInfo().ColumnName);
 }
Ejemplo n.º 8
0
 public object GetPropertyValue(InventoryPropertyName property)
 {
     return(_properties[property]);
 }
Ejemplo n.º 9
0
 protected QueryFilterExpression(FilterExpressionOperator theOperator, InventoryPropertyName propertyName, T parameter)
 {
     Operator     = theOperator;
     PropertyName = propertyName;
     Parameter    = parameter;
 }
Ejemplo n.º 10
0
 public QueryFilterExpressionLikes(InventoryPropertyName propertyName, string parameter) :
     base(FilterExpressionOperator.Likes, propertyName, parameter)
 {
 }