Esempio n. 1
0
        /// <summary>
        /// 插入数据
        /// </summary>
        /// <param name="roleFunctionEntities">数据实体</param>
        public static void BatchInserFunction(List <RoleFunctionEntity> roleFunctionEntities)
        {
            var cmd = new DataCommand("Function.BatchInserFunction");

            cmd.CommandText = cmd.CommandText.Replace("#TEMPLATE#", cmd.GetTemporaryTableScript("templateTable", roleFunctionEntities));
            cmd.ExecuteNonQuery();
        }
Esempio n. 2
0
        public static void BatchInserArticleUser(List <ArticleUser> list)
        {
            var cmd            = new DataCommand("Article.BatchInserArticleUser");
            var temp           = list.First();
            var templateScript = cmd.GetTemporaryTableScript <ArticleUser>("LYYTEAMPLATE", list);

            cmd.SetParameter("@ArticleId", DbType.Int32, temp.ArticleId);
            cmd.CommandText = cmd.CommandText.Replace("#TEMPLATETABLE#", templateScript);
            cmd.ExecuteNonQuery();
        }