Beispiel #1
0
 public override string BuildAlterColumnStatement(IColumn column)
 {
     //SQLite doesn't support altering columns. There is no typing either, or length considerations
     //so - unless we're adding/dropping, fuggedaboutit
     //http://stackoverflow.com/questions/623044/how-to-alter-sqlite-column-iphone
     return "";
 }
Beispiel #2
0
        public override string ModifyColumn(IColumn fromColumn, IColumn toColumn) {
            var sql = new StringBuilder();

            // drop a column constraint if need be
            if (!string.IsNullOrEmpty(fromColumn.Default) && !fromColumn.IsPrimaryKey && !fromColumn.IsAutoGenerated
                && (string.IsNullOrEmpty(toColumn.Default) || fromColumn.Default != toColumn.Default)) {
                sql.AppendLine(this.OnBeforeDropColumn(fromColumn));
            }

            // alter the column
            sql.Append("alter table ");
            this.AppendQuotedTableName(sql, toColumn.Map);
            sql.Append(" alter column ");
            this.AppendColumnSpecification(sql, toColumn, false);

            // add a column constraint if need be
            if (!string.IsNullOrEmpty(toColumn.Default) && !toColumn.IsPrimaryKey && !toColumn.IsAutoGenerated) {
                sql.AppendLine(";");
                sql.Append("alter table ");
                this.AppendQuotedTableName(sql, toColumn.Map);
                sql.Append(" add default (");
                sql.Append(toColumn.Default);
                sql.Append(") for");
                this.AppendQuotedName(sql, toColumn.DbName);
            }

            return sql.ToString();
        }
Beispiel #3
0
 public string AddColumn(IColumn column) {
     var sql = new StringBuilder("alter table ");
     this.dialect.AppendQuotedTableName(sql, column.Map);
     sql.Append(" add ");
     this.dialect.AppendColumnSpecification(sql, column);
     return sql.ToString();
 }
        public void To(IColumn column)
        {
            RemoveOldMapping();

            if (column == null)
            {
                ms.InvalidateCache();
                return;
            }

            var mapping = ms.GetMappingFor(property.Component);

            if (mapping == null)
            {
                mapping = new ComponentMappingImpl();
                mapping.ToComponent = property.Component;
                mapping.FromTable = column.Parent;
                mapping.AddPropertyAndColumn(property, column);

                ms.AddMapping(mapping);
            }
            else
            {
                mapping.SetMapping(property, column);
                ms.InvalidateCache();
            }
        }
Beispiel #5
0
        private static IEnumerable<ModelClientValidationRule> GetClientValidationRule(IColumn column)
        {
            if (column.DataType == DataType.Int || column.DataType == DataType.Decimal)
            {
                yield return new ModelClientValidationRule()
                     {
                         ValidationType = "number",
                         ErrorMessage = string.Format(SR.GetString("ClientDataTypeModelValidatorProvider_FieldMustBeNumeric"), column.Name)
                     };
            }
            if (column.DataType == DataType.String && column.Length > 0)
            {
                yield return new ModelClientValidationStringLengthRule(string.Format(SR.GetString("StringLengthAttribute_ValidationError"), column.Name, column.Length)
                    , 0, column.Length);
            }
            if (!column.AllowNull)
            {
                yield return new ModelClientValidationRequiredRule(string.Format(SR.GetString("RequiredAttribute_ValidationError"), column.Name));
            }
            if (column.Validations != null)
            {
                foreach (var validation in column.Validations)
                {
                    foreach (var clientValidation in validation.GetClientValidationRule(column.Name))
                    {
                        yield return clientValidation;
                    }
                }
            }

        }
 public static void SetMappedColumn(this ComponentPropertyMarker property, IColumn column)
 {
     if (property == null) throw new ArgumentNullException("property");
     var set = property.GetMappingSet();
     if (set == null) throw new Exception(string.Format("Could not set Mapped Column for Property {0}: Could not get its MappingSet", property.PropertyName));
     set.ChangeMappingFor(property).To(column);
 }
Beispiel #7
0
        public static IDictionary<string, object> GetUnobtrusiveValidationAttributes(IColumn column)
        {
            Dictionary<string, object> resultsDictionary = new Dictionary<string, object>();

            string fullHtmlFieldName = column.Name;

            IEnumerable<ModelClientValidationRule> enumerable = GetClientValidationRule(column);
            bool flag = false;
            foreach (ModelClientValidationRule rule in enumerable)
            {
                flag = true;
                string dictionaryKey = "data-val-" + rule.ValidationType;
                //ValidateUnobtrusiveValidationRule(rule, resultsDictionary, dictionaryKey);
                resultsDictionary[dictionaryKey] = HttpUtility.HtmlEncode(rule.ErrorMessage ?? string.Empty);
                dictionaryKey = dictionaryKey + "-";
                foreach (KeyValuePair<string, object> pair in rule.ValidationParameters)
                {
                    resultsDictionary[dictionaryKey + pair.Key] = pair.Value.ToString() ?? string.Empty;
                }
            }
            if (flag)
            {
                resultsDictionary.Add("data-val", "true");
            }

            return resultsDictionary;
        }
        /// <summary>
        /// Adds the column.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="column">The column.</param>
        /// <returns></returns>
        public virtual string BuildAddColumnStatement(string tableName, IColumn column)
        {
            var sql = new StringBuilder();

            //if we're adding a Non-null column to the DB schema, there has to be a default value
            //otherwise it will result in an error'
            if (!column.IsNullable && column.DefaultSetting == null)
            {
                SetColumnDefaults(column);
            }

            sql.AppendFormat(ADD_COLUMN, tableName, column.Name, GenerateColumnAttributes(column));
            
            //if the column isn't nullable and there are records already
            //the default setting won't be honored and a null value could be entered (in SQLite for instance)
            //enforce the default setting here
            if(!column.IsNullable)
            {
                sql.AppendLine();

                var defaultValue = column.DefaultSetting;

                if (column.IsString || column.IsDateTime)
                {
                    defaultValue = String.Format("'{0}'", column.DefaultSetting);
                }

                sql.AppendFormat(UPDATE_DEFAULTS, tableName, column.Name, defaultValue);
            }
            
            return sql.ToString();
        }
Beispiel #9
0
        protected void AppendColumnSpecificationWithoutName(StringBuilder sql, IColumn column, bool scriptDefault = true) {
            sql.Append(this.TypeName(column.DbType));

            if (column.DbType.TypeTakesLength()) {
                sql.Append("(");
                if (column.MaxLength) {
                    sql.Append("max");
                }
                else {
                    sql.Append(column.Length);
                }

                sql.Append(")");
            }

            if (column.DbType.TypeTakesPrecisionAndScale()) {
                this.AppendPrecisionAndScale(sql, column.Precision, column.Scale);
            }

            sql.Append(column.IsNullable ? " null" : " not null");

            if (scriptDefault && !string.IsNullOrEmpty(column.Default) && !column.IsPrimaryKey && !column.IsAutoGenerated) {
                this.AppendDefault(sql, column);
            }

            if (column.IsAutoGenerated) {
                this.AppendAutoGenerateModifier(sql, column);
            }

            if (column.IsPrimaryKey) {
                sql.Append(" primary key");
            }
        }
Beispiel #10
0
 public override string ModifyColumn(IColumn fromColumn, IColumn toColumn) {
     var sql = new StringBuilder("alter table ");
     this.AppendQuotedTableName(sql, toColumn.Map);
     sql.Append(" modify column ");
     this.AppendColumnSpecification(sql, toColumn);
     return sql.ToString();
 }
Beispiel #11
0
        protected override string RenderInput(IColumn column)
        {
            StringBuilder sb = new StringBuilder(string.Format(@"@{{ var radioDefaultValue_{0} = @""{1}"";}}", column.Name, column.DefaultValue.EscapeQuote()));
            if (!string.IsNullOrEmpty(column.SelectionFolder))
            {
                sb.AppendFormat(@"
                        @{{
                            var textFolder_{0} = new TextFolder(Repository.Current, ""{1}"");
                            var query_{0} = textFolder_{0}.CreateQuery().DefaultOrder();
                        }}
                        @foreach (var item in query_{0})
                        {{
                           <input id=""{0}"" name=""{0}"" type=""radio"" value=""@item.UUID""  @((Model.{0} != null && Model.{0}.ToString().ToLower() == @item.UUID.ToLower()) || (Model.{0} == null && radioDefaultValue_{0}.ToLower() == @item.UUID.ToLower()) ? ""checked"" : """")/><label for=""{0}"">@item.GetSummary()</label>
                        }}
                        ", column.Name, column.SelectionFolder);
            }
            else
            {

                if (column.SelectionItems != null)
                {
                    var index = 0;
                    foreach (var item in column.SelectionItems)
                    {
                        var id = column.Name + "_" + index.ToString();
                        index++;
                        sb.AppendFormat(@"
            <input id=""{0}"" name=""{1}"" type=""radio"" value=""@(@""{2}"")""  @((Model.{1} != null && Model.{1}.ToString().ToLower() == @""{2}"".ToLower()) || (Model.{1} == null && radioDefaultValue_{1}.ToLower() == @""{2}"".ToLower()) ? ""checked"" : """")/><label for=""{0}"">{3}</label>"
                            , id, column.Name, item.Value.EscapeQuote(), item.Text);
                    }
                }

            }
            return sb.ToString();
        }
Beispiel #12
0
 public FilterListProperty(string displayname, IColumn column, Func<Dictionary<string, string>> valueList)
 {
     Type = FilterType.List;
     DisplayName = ResourceManager.GetString(displayname);
     Column = column;
     Operators = new[] { OperatorType.In, OperatorType.NotIn };
     ValueList = valueList;
 }
		void RenderColumnHeader(IColumn c, Painter p, Node n)
		{
			p.SetPosition(c.Left);
			if (c.Left > 0)
				p.DrawSeparatorLine(Pens.Black);
			p.Pad(4);
			p.DrawString(c.Name, Font, Brushes.Black, 3, c.Left + c.Width);
		}
Beispiel #14
0
        public override string Render(ISchema schema, IColumn column)
        {
            string html = string.Format(CheckBoxTemplate, column.Name,
                 (string.IsNullOrEmpty(column.Label) ? column.Name : column.Label).RazorHtmlEncode(), RenderInput(column),
                 FormHelper.Tooltip(column.Tooltip));

            return html;
        }
Beispiel #15
0
        public virtual string Render(ISchema schema, IColumn column)
        {
            string html = string.Format(EditorTemplate, column.Name,
                (string.IsNullOrEmpty(column.Label) ? column.Name : column.Label).RazorHtmlEncode(), RenderInput(column),
                string.IsNullOrEmpty(column.Tooltip) ? "" : string.Format(@"<a href=""javascript:;"" class=""tooltip-link"" title='{0}'></a>", (column.Tooltip).RazorHtmlEncode()));

            return html;
        }
Beispiel #16
0
 public DateTimeProperty(string displayname, IColumn column)
 {
     Type = FilterType.DateTime;
     //            DisplayPrefix = "txt";
     DisplayName = ResourceManager.GetString(displayname);
     Column = column;
     Operators = new[] { OperatorType.IsEqual, OperatorType.IsLarger, OperatorType.IsLargerOrEqual, OperatorType.IsSmaller, OperatorType.IsSmallerOrEqual };
 }
Beispiel #17
0
 public string DropColumn(IColumn column) {
     var beforeSql = this.dialect.OnBeforeDropColumn(column);
     var sql = new StringBuilder("alter table ");
     this.dialect.AppendQuotedTableName(sql, column.Map);
     sql.Append(" drop column ");
     this.dialect.AppendQuotedName(sql, column.DbName);
     return beforeSql + sql;
 }
Beispiel #18
0
 public void RemoveColumn(IColumn column)
 {
     if (!(column is GridViewColumnWrapper))
         throw new Exception("Only GridViewColumnWrapper are allowed.");
     var gridViewColumnWrapper = (GridViewColumnWrapper)column;
     if (!_extendedGridView.RemoveColumn(gridViewColumnWrapper.GridViewColumn))
         throw new Exception("The given GridViewColumnWrapper was not an element of the collection.");
 }
 public ColumnContainer(IColumn parentColumn)
 {
     Id = System.Guid.NewGuid().ToString();
     if (parentColumn.Size < ColumnSize.Size2) throw new ArgumentOutOfRangeException("Column Containers must be sizes 2 through 12");
     _Parent = parentColumn;
     this.SpacerAbove = true;
     InitColumns();            
 }
Beispiel #20
0
 public BooleanProperty(string displayname, IColumn column)
 {
     Type = FilterType.Boolean;
     //            DisplayPrefix = "cbx";
     DisplayName = ResourceManager.GetString(displayname);
     Column = column;
     Operators = new[] { OperatorType.IsEqual };
 }
Beispiel #21
0
        public override string QualifyColumnName(IColumn column)
        {
            string qualifiedFormat;

            qualifiedFormat = String.IsNullOrEmpty(column.SchemaName) ? "`{2}`" : "`{0}`.`{1}`.`{2}`";
        
            return String.Format(qualifiedFormat, column.Table.SchemaName, column.Table.Name, column.Name);
        }
Beispiel #22
0
 public NumericProperty(string displayname, IColumn column)
 {
     Type = FilterType.Number;
     //            DisplayPrefix = "txt";
     DisplayName = ResourceManager.GetString(displayname);
     Column = column;
     Operators = new[] { OperatorType.IsEqual, OperatorType.IsLarger, OperatorType.IsLargerOrEqual, OperatorType.IsSmaller, OperatorType.IsSmallerOrEqual, OperatorType.IsNotEqualOrIsNull };
 }
Beispiel #23
0
 protected override void AppendAutoGenerateModifier(StringBuilder sql, IColumn column) {
     if (column.Type == typeof(Guid)) {
         sql.Append(" NEWSEQUENTIALID()");
     }
     else {
         sql.Append(" identity(1,1)");
     }
 }
Beispiel #24
0
 public TextProperty(string displayname, IColumn column)
 {
     Type = FilterType.Text;
     //            DisplayPrefix = "txt";
     DisplayName = ResourceManager.GetString(displayname);
     Column = column;
     Operators = new[] { OperatorType.IsEqual, OperatorType.Like, OperatorType.IsNotEqualOrIsNull };
 }
Beispiel #25
0
        protected override string RenderInput(IColumn column)
        {
            string formater = @"<input class=""medium"" id=""{0}"" name=""{0}"" type=""text"" value=""@(Model.{0} ?? """")"" {1} readonly=""readonly""/>
<a href=""javascript:;"" class=""image-croper action"" inputid = ""{0}"">@Html.IconImage(""plus"")</a>
<input id=""{0}-hidden"" name=""{0}-hidden"" type=""hidden"" value=""@(Model.{0} ?? """")""/>
<input type=""hidden"" name=""{2}"" value=""{0}""/>";

            return string.Format(formater, column.Name, Kooboo.CMS.Form.Html.ValidationExtensions.GetUnobtrusiveValidationAttributeString(column), KoobooImageCropInputName);
        }
Beispiel #26
0
        public CellData(IColumn column, object defaultValue)
        {
            #region Guards
            if (column == null) throw new ArgumentNullException("column", "column cannot be null");
            #endregion

            Column = column;
            Value = defaultValue;
        }
Beispiel #27
0
        protected override string RenderInput(IColumn column)
        {
            StringBuilder sb = new StringBuilder(string.Format(@"@{{ var checkBoxListDefaultValue_{0} = @""{1}"".Split(new []{{','}},StringSplitOptions.RemoveEmptyEntries);
                        var values_{0} = new string[0];
                        if(!string.IsNullOrEmpty(Model.{0}))
                        {{
                            values_{0}=Model.{0}.Split(new []{{','}},StringSplitOptions.RemoveEmptyEntries);
                        }}
                        }}", column.Name, column.DefaultValue.EscapeQuote()));

            if (column.SelectionSource == SelectionSource.TextFolder)
            {
                sb.AppendFormat(@"
                        @{{
                           var textFolder_{0} = new TextFolder(Repository.Current, ""{1}"");
                           var query_{0} = textFolder_{0}.CreateQuery().DefaultOrder(); 
                           var index_{0} = 0;
                        }}
                        <input type='hidden' name='{0}'/>
                        <ul class=""checkbox-list"">
                        @foreach (var item in query_{0})
                        {{                            
                            var id = ""{0}"" + index_{0}.ToString();
                            <li>
                             <input id=""@id"" name=""{0}"" type=""checkbox"" value=""@item.UUID""  @((Model.{0} == null && checkBoxListDefaultValue_{0}.Contains(@item.UUID, StringComparer.OrdinalIgnoreCase)) || (Model.{0} != null && values_{0}.Contains(@item.UUID, StringComparer.OrdinalIgnoreCase)) ? ""checked"" : """")/><label
                            for=""@id"" class=""inline"">@item.GetSummary()</label>
                            </li>
                            index_{0}++;                            
                        }}
                        </ul>
                        ", column.Name, column.SelectionFolder);
            }
            else
            {
                if (column.SelectionItems != null)
                {
                    var index = 0;
                    sb.AppendFormat(@"
<input type='hidden' name='{0}'/>
<ul class=""checkbox-list"">", column.Name);
                    foreach (var item in column.SelectionItems)
                    {
                        var id = column.Name + "_" + index.ToString();
                        index++;
                        sb.AppendFormat(@"
<li>
<input id=""{0}"" name=""{1}"" type=""checkbox"" value=""@(@""{2}"")""  @((Model.{1} == null && checkBoxListDefaultValue_{1}.Contains(@""{2}"",StringComparer.OrdinalIgnoreCase))  || (Model.{1} != null && values_{1}.Contains(@""{2}"",StringComparer.OrdinalIgnoreCase)) ? ""checked"" : """")/><label for=""{0}"" class=""inline"">{3}</label>
</li>"
                            , id, column.Name, item.Value.EscapeQuote(), item.Text);
                    }
                    sb.Append("</ul>");
                }
            }


            return sb.ToString();
        }
Beispiel #28
0
 public ListProperty(string displayname, IColumn column, Func<Dictionary<string, string>> valueList)
 {
     Type = FilterType.List;
     //            DisplayPrefix = "ddl";
     DisplayName = ResourceManager.GetString(displayname);
     Column = column;
     Operators = new[] { OperatorType.IsEqual, OperatorType.IsNotEqualOrIsNull };
     ValueList = valueList;
 }
Beispiel #29
0
        public override string BuildAddColumnStatement(string tableName, IColumn column)
        {
            //if we're adding a Non-null column to the DB schema, there has to be a default value
            //otherwise it will result in an error'
            if (!column.IsNullable && column.DefaultSetting == null)
                SetColumnDefaults(column);

            return string.Format(ADD_COLUMN, tableName, column.Name, GenerateColumnAttributes(column));
        }
        public override void DetachFromModel()
        {
            if (Detached || Column == null) return;

            Column.PropertyChanged -= Column_PropertyChanged;
            Column = null;
            Detached = true;
            SetupForm();
        }
 /// <summary>
 /// Should return if its a identity (auto increment, or new sequential guid example for sql server
 /// </summary>
 /// <param name="column"></param>
 /// <returns></returns>
 protected virtual bool IsGenerateOptionIdentity(IColumn column) => column.IsAutoIncrement;
Beispiel #32
0
 public AliasedColumn(IColumn column, string columnAlias)
 {
     this.column      = column;
     this.columnAlias = columnAlias;
 }
Beispiel #33
0
 public void RemoveColumn(IColumn <Item> column)
 {
     Columns.Remove(column);
     StateHasChanged();
 }
 public ColumnItem(IColumn column)
 {
     Column = column;
 }
Beispiel #35
0
        public bool HasChanges(IColumn value, out string description)
        {
            StringBuilder sb = new StringBuilder();

            if (base.HasChanges(value))
            {
                sb.Append("Value,");
            }
            if (Size != value.Size)
            {
                sb.Append("Size,");
            }
            if (SizeIsMax != value.SizeIsMax)
            {
                sb.Append("SizeIsMax,");
            }
            if (Scale != value.Scale)
            {
                sb.Append("Scale,");
            }
            if (OriginalDataType != value.OriginalDataType)
            {
                sb.Append("Datatype,");
            }
            if (OrdinalPosition != value.OrdinalPosition)
            {
                sb.Append("OrdinalPosition,");
            }
            if (InPrimaryKey != value.InPrimaryKey)
            {
                sb.Append("InPrimaryKey,");
            }
            if (IsComputed != value.IsComputed)
            {
                sb.Append("IsComputed,");
            }
            if (IsCalculated != value.IsCalculated)
            {
                sb.Append("IsCalculated,");
            }
            if (IsIdentity != value.IsIdentity)
            {
                sb.Append("IsIdentity,");
            }
            if (IsNullable != value.IsNullable)
            {
                sb.Append("IsNullable,");
            }
            if (IsReadOnly != value.IsReadOnly)
            {
                sb.Append("IsReadOnly,");
            }
            if (Precision != value.Precision)
            {
                sb.Append("Precision,");
            }

            if (sb.Length > 0)
            {
                description = sb.ToString().TrimEnd(',');
                return(true);
            }
            description = "";
            return(false);
        }
Beispiel #36
0
        private static SqlPreCommandSimple UpdateByFkChange(string tn, DiffColumn difCol, IColumn tabCol, Func <ObjectName, ObjectName> changeName)
        {
            if (difCol.ForeignKey == null || tabCol.ReferenceTable == null || tabCol.AvoidForeignKey)
            {
                return(null);
            }

            ObjectName oldFk = changeName(difCol.ForeignKey.TargetTable);

            if (oldFk.Equals(tabCol.ReferenceTable.Name))
            {
                return(null);
            }

            AliasGenerator ag = new AliasGenerator();

            return(new SqlPreCommandSimple(
                       @"UPDATE {2}
SET {0} =  -- get {5} id from {4}.Id
FROM {1} {2}
JOIN {3} {4} ON {2}.{0} = {4}.Id".FormatWith(tabCol.Name,
                                             tn, ag.NextTableAlias(tn),
                                             oldFk, ag.NextTableAlias(oldFk.Name),
                                             tabCol.ReferenceTable.Name.Name)));
        }
Beispiel #37
0
        /// <summary>
        /// Sums the specified col.
        /// </summary>
        /// <param name="col">The col.</param>
        /// <returns></returns>
        public static Aggregate Sum(IColumn col)
        {
            Aggregate agg = new Aggregate(col, AggregateFunction.Sum);

            return(agg);
        }
Beispiel #38
0
 /// <inheritdoc />
 public virtual IEnumerable <IAnnotation> For(IColumn column, bool designTime)
 => Enumerable.Empty <IAnnotation>();
Beispiel #39
0
 protected SqlServer2000Generator(IColumn column)
     : base(column, new SqlServerQuoter())
 {
 }
Beispiel #40
0
 public override void GetOrBuildColumns()
 {
     People = GetOrBuild(nameof(People), () => (IColumn <NumberList <int> >) new RefListColumn(nameof(PersonDatabase.Person)));
 }
Beispiel #41
0
 public override string ChangeColumnName(IColumn fromColumn, IColumn toColumn)
 {
     return("EXEC sp_RENAME '" + toColumn.Map.Table + "." + fromColumn.DbName + "', '" + toColumn.DbName + "', 'COLUMN'");
 }
Beispiel #42
0
 public ColumnCommand(IColumn column)
 {
     Column = column;
 }
Beispiel #43
0
        /// <summary>
        /// Groups the by.
        /// </summary>
        /// <param name="col">The col.</param>
        /// <returns></returns>
        public static Aggregate GroupBy(IColumn col)
        {
            Aggregate agg = new Aggregate(col, AggregateFunction.GroupBy);

            return(agg);
        }
Beispiel #44
0
 /// <inheritdoc/>
 public void AddColumn(IColumn col)
 {
     AddColumn(col, true);
 }
 /// <inheritdoc />
 public virtual IEnumerable <IAnnotation> For(IColumn column) => Enumerable.Empty <IAnnotation>();
 private static string GetSortDefinition(this IEnumerable <ColumnDefinition> colDefs, IColumn sortColumn, bool sortOnWebServer)
 {
     return(sortOnWebServer ?
            $"{sortColumn.Name} {(sortColumn.Sort.Direction == SortDirection.Ascending ? "ASC" : "DESC")}" :
            $"{colDefs.Single(d => d.Name == sortColumn.Name).ColumnName} {(sortColumn.Sort.Direction == SortDirection.Ascending ? "ASC" : "DESC")}");
 }
Beispiel #47
0
 protected abstract string OnFormatColumnName(IColumn Column, bool FullName);
Beispiel #48
0
        /// <summary>
        /// Counts the specified col.
        /// </summary>
        /// <param name="col">The col.</param>
        /// <param name="alias">The alias.</param>
        /// <returns></returns>
        public static Aggregate Count(IColumn col, string alias)
        {
            Aggregate agg = new Aggregate(col, alias, AggregateFunction.Count);

            return(agg);
        }
Beispiel #49
0
 public GenericGenerator(IColumn column, IQuoter quoter)
     : base(column, quoter)
 {
     compatabilityMode = CompatabilityMode.LOOSE;
 }
Beispiel #50
0
        /// <summary>
        /// Counts the specified col.
        /// </summary>
        /// <param name="col">The col.</param>
        /// <returns></returns>
        public static Aggregate Count(IColumn col)
        {
            Aggregate agg = new Aggregate(col, AggregateFunction.Count);

            return(agg);
        }
Beispiel #51
0
 public IInsert Set <TVal>(IColumn <TVal> Column, TVal Value)
     where TVal : class
 {
     setters.Add(new ClassSetter <TVal>(Column, Value));
     return(this);
 }
Beispiel #52
0
        /// <summary>
        /// Standards the deviation.
        /// </summary>
        /// <param name="col">The col.</param>
        /// <param name="alias">The alias.</param>
        /// <returns></returns>
        public static Aggregate StandardDeviation(IColumn col, string alias)
        {
            Aggregate agg = new Aggregate(col, alias, AggregateFunction.StDev);

            return(agg);
        }
Beispiel #53
0
 public IInsert Set <TVal>(IColumn <TVal> Column, TVal?Value)
     where TVal : struct
 {
     setters.Add(new ValueSetter <TVal>(Column, Value));
     return(this);
 }
Beispiel #54
0
        /// <summary>
        /// Variances the specified col.
        /// </summary>
        /// <param name="col">The col.</param>
        /// <param name="alias">The alias.</param>
        /// <returns></returns>
        public static Aggregate Variance(IColumn col, string alias)
        {
            Aggregate agg = new Aggregate(col, alias, AggregateFunction.Var);

            return(agg);
        }
Beispiel #55
0
        /// <summary>
        /// Variances the specified col.
        /// </summary>
        /// <param name="col">The col.</param>
        /// <returns></returns>
        public static Aggregate Variance(IColumn col)
        {
            Aggregate agg = new Aggregate(col, AggregateFunction.Var);

            return(agg);
        }
Beispiel #56
0
        /// <summary>
        /// Mins the specified col.
        /// </summary>
        /// <param name="col">The col.</param>
        /// <returns></returns>
        public static Aggregate Min(IColumn col)
        {
            Aggregate agg = new Aggregate(col, AggregateFunction.Min);

            return(agg);
        }
Beispiel #57
0
 public ColumnTable(ITable table, IColumn column)
 {
     Table  = table;
     Column = column;
 }
Beispiel #58
0
        /// <summary>
        /// Groups the by.
        /// </summary>
        /// <param name="col">The col.</param>
        /// <param name="alias">The alias.</param>
        /// <returns></returns>
        public static Aggregate GroupBy(IColumn col, string alias)
        {
            Aggregate agg = new Aggregate(col, alias, AggregateFunction.GroupBy);

            return(agg);
        }
Beispiel #59
0
        /*public Setter()
         * {
         *
         * }*/

        public ClassSetter(IColumn <TVal> Column, TVal Value)
        {
            this.Column = Column; this.Value = Value;
        }
Beispiel #60
0
 // ColumnFactory untyped constructor
 public ListColumn(IColumn values, object defaultValue) : this((IColumn <T>)values, (defaultValue == null ? Nullability.DefaultToNull : Nullability.DefaultToEmpty))
 {
 }