Esempio n. 1
0
        /// <summary>
        /// Gets the update statement.
        /// </summary>
        /// <returns>
        /// The <see cref="DatabaseStatement"/>.
        /// </returns>
        public DatabaseStatement GetUpdateStatement()
        {
            if (this.updateStatement != null)
            {
                return(this.updateStatement);
            }

            this.updateStatement = new DatabaseStatement(this.Database);
            if (!this.updateStatement.Prepare(this.GetUpdateStatementString()))
            {
                this.updateStatement = null;
            }

            return(this.updateStatement);
        }
Esempio n. 2
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;
        }