Ejemplo n.º 1
0
    /// <summary>
    /// 将html内容参数存入数据库
    /// </summary>
    /// <param name="info"></param>
    public void AddHtml(htmlPara info)
    {
        int a = SqlHelperCatalog.ExecuteNonQuery(@"INSERT INTO htmlPara
     ([title]
       ,[titleURL]
       ,[articlecontent]
       ,[columnId]
       ,[pinpai]
       ,[xinghao]
       ,[price]
       ,[smallCount]
       ,[sumCount]
       ,[unit]
       ,[city]
       ,[titleImg]
       ,[addTime]
       ,[ten_qq]
       ,[companyName]
       ,[com_web]
       ,[userId]
       ,[userName])
 VALUES
       (@title
       ,@titleURL+CONVERT(varchar(10), IDENT_CURRENT('htmlPara'))+'.html'
       ,@articlecontent
       ,@columnId
       ,@pinpai
       ,@xinghao
       ,@price
       ,@smallCount
       ,@sumCount
       ,@unit
       ,@city
       ,@titleImg
       ,@addTime
       ,@ten_qq
       ,@companyName
       ,@com_web
       ,@userId
       ,@userName)",
                                                 new SqlParameter("@title", SqlHelper.ToDBNull(info.title)),
                                                 new SqlParameter("@titleURL", SqlHelper.ToDBNull(info.titleURL)),
                                                 new SqlParameter("@articlecontent", SqlHelper.ToDBNull(info.articlecontent)),
                                                 new SqlParameter("@columnId", SqlHelper.ToDBNull(info.columnId)),
                                                 new SqlParameter("@pinpai", SqlHelper.ToDBNull(info.pinpai)),
                                                 new SqlParameter("@xinghao", SqlHelper.ToDBNull(info.xinghao)),
                                                 new SqlParameter("@price", SqlHelper.ToDBNull(info.price)),
                                                 new SqlParameter("@smallCount", SqlHelper.ToDBNull(info.smallCount)),
                                                 new SqlParameter("@sumCount", SqlHelper.ToDBNull(info.sumCount)),
                                                 new SqlParameter("@unit", SqlHelper.ToDBNull(info.unit)),
                                                 new SqlParameter("@city", SqlHelper.ToDBNull(info.city)),
                                                 new SqlParameter("@titleImg", SqlHelper.ToDBNull(info.titleImg)),
                                                 new SqlParameter("@addTime", SqlHelper.ToDBNull(info.addTime)),
                                                 new SqlParameter("@ten_qq", SqlHelper.ToDBNull(info.ten_qq)),
                                                 new SqlParameter("@companyName", SqlHelper.ToDBNull(info.companyName)),
                                                 new SqlParameter("@com_web", SqlHelper.ToDBNull(info.com_web)),
                                                 new SqlParameter("@userId", SqlHelper.ToDBNull(info.userId)),
                                                 new SqlParameter("@userName", SqlHelper.ToDBNull(info.username)));
    }