/// <summary>
 /// Initializes a new instance of the <see cref="DatabaseRecordSet"/> class.
 /// </summary>
 /// <param name="query">
 /// The query.
 /// </param>
 public DatabaseRecordSet(DatabaseQuery query)
     : base(query?.Database)
 {
     this.Query             = query;
     this.HasQueryOwnership = false;
     this.BuildResult(0);
 }
Example #2
0
        /// <summary>
        /// Gets the exists query.
        /// </summary>
        /// <returns>
        /// The <see cref="DatabaseQuery"/>.
        /// </returns>
        public DatabaseQuery GetExistsQuery()
        {
            if (this.existsStatement != null)
            {
                return(this.existsStatement);
            }

            this.existsStatement = new DatabaseQuery(this.Database);
            if (!this.existsStatement.Prepare(this.GetExistsStatementString()))
            {
                this.existsStatement = null;
            }

            return(this.existsStatement);
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RecordTemplate"/> class.
        /// </summary>
        /// <param name="database">
        /// The database.
        /// </param>
        /// <param name="infoAreaId">
        /// The information area identifier.
        /// </param>
        /// <param name="fieldIdCount">
        /// The field identifier count.
        /// </param>
        /// <param name="fieldids">
        /// The fieldids.
        /// </param>
        /// <param name="linkFieldNameCount">
        /// The link field name count.
        /// </param>
        /// <param name="linkFieldNames">
        /// The link field names.
        /// </param>
        public RecordTemplate(
            CRMDatabase database,
            string infoAreaId,
            int fieldIdCount,
            FieldIdType[] fieldids,
            int linkFieldNameCount,
            List <string> linkFieldNames)
        {
            this.Database     = database;
            this.InfoAreaId   = infoAreaId;
            this.FieldIdCount = fieldIdCount;
            this.fieldIds     = fieldids;

            this.LinkFieldNameCount = linkFieldNameCount;
            if (linkFieldNames != null && linkFieldNameCount > 0)
            {
                this.linkFieldNames = new List <string>();
                for (var i = 0; i < linkFieldNameCount; i++)
                {
                    this.linkFieldNames.Add(linkFieldNames[i]);
                }
            }
            else
            {
                this.linkFieldNames = null;
            }

            this.insertStatementString = null;
            this.updateStatementString = null;
            this.selectStatementString = null;
            this.existsStatementString = null;
            this.deleteStatementString = null;
            this.tableinfo             = null;
            this.insertStatement       = null;
            this.updateStatement       = null;
            this.selectStatement       = null;
            this.existsStatement       = null;
            this.deleteStatement       = null;
        }