public Column AddColumn(Model.PropertyType PropertyType, Model.Query Query) { Column ret = null; switch (PropertyType.GetType().Name) { case "Boolean": ret = this.AddBooleanColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Date": ret = this.AddDateColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Decimal": ret = this.AddDecimalColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Federated": ret = this.AddFederatedColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Integer": ret = this.AddIntegerColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Item": ret = this.AddItemColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth, Query); break; case "List": ret = this.AddListColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Sequence": ret = this.AddSequenceColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "String": ret = this.AddStringColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; case "Text": ret = this.AddTextColumn(PropertyType.Name, PropertyType.Label, PropertyType.ColumnWidth); break; default: throw new Model.Exceptions.ArgumentException("PropertyType not implemented: " + PropertyType.GetType().Name); } return(ret); }
private Model.Condition Condition(Model.PropertyType PropertyType) { switch (PropertyType.GetType().Name) { case "String": case "Sequence": case "Text": return(Aras.Conditions.Like(PropertyType.Name, "%" + this.QueryString.Value + "%")); case "Integer": System.Int32 int32value = 0; if (System.Int32.TryParse(this.QueryString.Value, out int32value)) { return(Aras.Conditions.Eq(PropertyType.Name, int32value)); } else { return(null); } case "Decimal": System.Decimal decimalvalue = 0; if (System.Decimal.TryParse(this.QueryString.Value, out decimalvalue)) { return(Aras.Conditions.Eq(PropertyType.Name, decimalvalue)); } else { return(null); } default: return(null); } }
public ViewModel.Property CreateProperty(Model.PropertyType PropertyType, System.Boolean SubstitueStringForText) { ViewModel.Property viewmodelproperty = null; switch (PropertyType.GetType().Name) { case "String": viewmodelproperty = new Properties.String(this, (Model.PropertyTypes.String)PropertyType); break; case "Federated": viewmodelproperty = new Properties.Federated(this, (Model.PropertyTypes.Federated)PropertyType); break; case "Integer": viewmodelproperty = new Properties.Integer(this, (Model.PropertyTypes.Integer)PropertyType); break; case "Float": viewmodelproperty = new Properties.Float(this, (Model.PropertyTypes.Float)PropertyType); break; case "Sequence": viewmodelproperty = new Properties.Sequence(this, (Model.PropertyTypes.Sequence)PropertyType); break; case "Item": viewmodelproperty = new Properties.Item(this, (Model.PropertyTypes.Item)PropertyType); break; case "Decimal": viewmodelproperty = new Properties.Decimal(this, (Model.PropertyTypes.Decimal)PropertyType); break; case "Date": viewmodelproperty = new Properties.Date(this, (Model.PropertyTypes.Date)PropertyType); break; case "Text": if (SubstitueStringForText) { viewmodelproperty = new Properties.String(this, (Model.PropertyTypes.Text)PropertyType); } else { viewmodelproperty = new Properties.Text(this, (Model.PropertyTypes.Text)PropertyType); } break; case "Boolean": viewmodelproperty = new Properties.Boolean(this, (Model.PropertyTypes.Boolean)PropertyType); break; case "List": viewmodelproperty = new Properties.List(this, (Model.PropertyTypes.List)PropertyType); break; default: throw new Model.Exceptions.ArgumentException("PropertyType not implmented: " + PropertyType.GetType().Name); } return(viewmodelproperty); }