Exemple #1
0
 protected void AppendUpdateParameter(SPColumn column)
 {
     if (!column.IsKey)
     {
         _stringBuilder.AppendFormat("{0} = @{0}", column.Column.Name);
     }
 }
Exemple #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);
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #5
0
 protected void AppendExecArgument(SPColumn column)
 {
     _stringBuilder.AppendFormat("\t\t@{0}{1}", column.Column.Name, column.IsKey ? " OUTPUT" : "");
 }
Exemple #6
0
 protected void AppendParameter(SPColumn column)
 {
     _stringBuilder.AppendFormat("\t@{0} {1} {2}", column.Column.Name, column.Column.Type, column.IsKey ? "OUTPUT" : "");
 }
Exemple #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;
        }
Exemple #8
0
 protected void AppendUpdateParameter(SPColumn column)
 {
     if (!column.IsKey)
     {
         _stringBuilder.AppendFormat("{0} = @{0}", column.Column.Name);
     }
 }
Exemple #9
0
 protected void AppendExecArgument(SPColumn column)
 {
     _stringBuilder.AppendFormat("\t\t@{0}{1}", column.Column.Name, column.IsKey ? " OUTPUT" : "");
 }
Exemple #10
0
 protected void AppendParameter(SPColumn column)
 {
     _stringBuilder.AppendFormat("\t@{0} {1} {2}", column.Column.Name, column.Column.Type, column.IsKey ? "OUTPUT" : "");
 }