コード例 #1
0
 /// <summary>
 /// The insert article to category.
 /// </summary>
 /// <param name="article">
 /// The article.
 /// </param>
 /// <param name="category">
 /// The category.
 /// </param>
 /// <returns>
 /// The <see cref="bool"/>.
 /// </returns>
 public bool InsertArticleToCategory(Article article, Category category)
 {
     return this._contextcaCategoryOracleContext.InsertArticleToCategory(article, category);
 }
コード例 #2
0
        /// <summary>
        /// The insert article to category.
        /// </summary>
        /// <param name="article">
        /// The article.
        /// </param>
        /// <param name="category">
        /// The category.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public bool InsertArticleToCategory(Article article, Category category)
        {
            var query =
            "INSERT INTO artikel_categorie (catid, artikelnummer) VALUES (:catid, :articleid)";
            var parameters = new List<OracleParameter>
            {
                new OracleParameter("catid", category.Id),
                new OracleParameter("articleid", article.Id)
            };

            if (!Database.ExecuteNonQuery(query)) return false;
            return true;
        }