Beispiel #1
0
 protected void AppendUpdateParameter(SPColumn column)
 {
     if (!column.IsKey)
     {
         _stringBuilder.AppendFormat("{0} = @{0}", column.Column.Name);
     }
 }
Beispiel #2
0
        private SPColumn IsKeyOrIdentityColumn(Column column)
        {
            SPColumn sqlColumn = new SPColumn();

            sqlColumn.Column     = column;
            sqlColumn.IsKey      = false;
            sqlColumn.IsIdentity = false;

            /* TODO
             * foreach (LogicalReference r in column.References)
             * {
             *  if (r is Key)
             *  {
             *      if (r.Parent is PrimaryKeyConstraint)
             *      {
             *          sqlColumn.IsKey = true;
             *          _keyColumn = sqlColumn;
             *          break;
             *      }
             *
             *      if (r.Parent is IdentityConstraint)
             *      {
             *          sqlColumn.IsIdentity = true;
             *          _identityColumn = sqlColumn;
             *          break;
             *      }
             *  }
             * }*/
            return(sqlColumn);
        }
Beispiel #3
0
        public SPColumnsBuilder(Columns columns, bool bAppendSeparator) : base(bAppendSeparator)
        {
            foreach (Column column in columns.ColumnList)
            {
                _columns.Add(IsKeyOrIdentityColumn(column));
            }

            if (columns.Parent != null && columns.Parent is Table)
            {
                _table = (Table)columns.Parent;
            }
            else if (columns.Parent == null)
            {
                MessageEngine.Global.Trace(Severity.Error, Resources.ParentIsNull, columns.ToString());
            }
            else
            {
                MessageEngine.Global.Trace(Severity.Error, Resources.ColumnsParentIsNotTable, columns.Parent.Name);
            }
            _identityColumn = null;
            _keyColumn      = null;
        }
Beispiel #4
0
        public SPColumnsBuilder(Columns columns, bool bAppendSeparator) : base(bAppendSeparator)
        {
            foreach (Column column in columns.ColumnList)
            {
                _columns.Add(IsKeyOrIdentityColumn(column));
            }

            if (columns.Parent != null && columns.Parent is Table)
            {
                _table = (Table)columns.Parent;
            }
            else if (columns.Parent == null)
            {
                MessageEngine.Global.Trace(Severity.Error, Resources.ParentIsNull, columns.ToString());
            }
            else
            {
                MessageEngine.Global.Trace(Severity.Error, Resources.ColumnsParentIsNotTable, columns.Parent.Name);
            }
            _identityColumn = null;
            _keyColumn = null;
        }
Beispiel #5
0
 protected void AppendExecArgument(SPColumn column)
 {
     _stringBuilder.AppendFormat("\t\t@{0}{1}", column.Column.Name, column.IsKey ? " OUTPUT" : "");
 }
Beispiel #6
0
 protected void AppendParameter(SPColumn column)
 {
     _stringBuilder.AppendFormat("\t@{0} {1} {2}", column.Column.Name, column.Column.Type, column.IsKey ? "OUTPUT" : "");
 }
Beispiel #7
0
        private SPColumn IsKeyOrIdentityColumn(Column column)
        {
            SPColumn sqlColumn = new SPColumn();
            sqlColumn.Column = column;
            sqlColumn.IsKey = false;
            sqlColumn.IsIdentity = false;
            /* TODO
            foreach (LogicalReference r in column.References)
            {
                if (r is Key)
                {
                    if (r.Parent is PrimaryKeyConstraint)
                    {
                        sqlColumn.IsKey = true;
                        _keyColumn = sqlColumn;
                        break;
                    }

                    if (r.Parent is IdentityConstraint)
                    {
                        sqlColumn.IsIdentity = true;
                        _identityColumn = sqlColumn;
                        break;
                    }
                }
            }*/
            return sqlColumn;
        }
Beispiel #8
0
 protected void AppendUpdateParameter(SPColumn column)
 {
     if (!column.IsKey)
     {
         _stringBuilder.AppendFormat("{0} = @{0}", column.Column.Name);
     }
 }
Beispiel #9
0
 protected void AppendExecArgument(SPColumn column)
 {
     _stringBuilder.AppendFormat("\t\t@{0}{1}", column.Column.Name, column.IsKey ? " OUTPUT" : "");
 }
Beispiel #10
0
 protected void AppendParameter(SPColumn column)
 {
     _stringBuilder.AppendFormat("\t@{0} {1} {2}", column.Column.Name, column.Column.Type, column.IsKey ? "OUTPUT" : "");
 }