YKT_DAL/DALProduct.cs
(开头部分) 23KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using YKT.DBUtility;
using YKT_Model;
namespace YKT_DAL
{
public class DALProduct
{
#region 成员方法
/// <summary>
/// 得到最大ID
/// </summary>
public int GetMaxId()
{
return DbHelperSQL.GetMaxID("ID", "YKT_Product");
}
/// <summary>
/// 是否存在该记录
/// </summary>
public bool Exists(int ID)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select count(1) from YKT_Product");
strSql.Append(" where ID=@ID ");
SqlParameter[] parameters = {
new SqlParameter("@ID", SqlDbType.Int,4)};
parameters[0].Value = ID;
return DbHelperSQL.Exists(strSql.ToString(), parameters);
}
/// <summary>
/// 增加一条数据
/// </summary>
public void Add(ModelProduct model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into YKT_Product(");
strSql.Append("ID,ChannelID,ClassID,ProductName,ProductKeysWords,ProductCode,ProductBrand,ProductUnit,ProductWeight,ProductMarketPrice,ProductMemberPrice,ProductMinPrice,ProductBigPic,ProductSmallPic,ProductMorePic,ProductCount,ProductFieldType,ProductFields,ProductSingleFields,ProductSizeTable,IsPassed,IsOnSale,IsRecommond,IsOnHot,IsNew,IsSpecialOffer,Package,ShortContent,Content,ProductRelated,Hits,AddDateTime,UpDateTime,XjIDs)");
strSql.Append(" values (");
strSql.Append("@ID,@ChannelID,@ClassID,@ProductName,@ProductKeysWords,@ProductCode,@ProductBrand,@ProductUnit,@ProductWeight,@ProductMarketPrice,@ProductMemberPrice,@ProductMinPrice,@ProductBigPic,@ProductSmallPic,@ProductMorePic,@ProductCount,@ProductFieldType,@ProductFields,@ProductSingleFields,@ProductSizeTable,@IsPassed,@IsOnSale,@IsRecommond,@IsOnHot,@IsNew,@IsSpecialOffer,@Package,@ShortContent,@Content,@ProductRelated,@Hits,@AddDateTime,@UpDateTime,@XjIDs)");
SqlParameter[] parameters = {
new SqlParameter("@ID", SqlDbType.Int,4),
new SqlParameter("@ChannelID", SqlDbType.Int,4),
new SqlParameter("@ClassID", SqlDbType.Int,4),
new SqlParameter("@ProductName", SqlDbType.NVarChar,50),
new SqlParameter("@ProductKeysWords", SqlDbType.NVarChar),
new SqlParameter("@ProductCode", SqlDbType.NVarChar,50),
new SqlParameter("@ProductBrand", SqlDbType.NVarChar,50),
new SqlParameter("@ProductUnit", SqlDbType.NVarChar,50),
new SqlParameter("@ProductWeight", SqlDbType.NVarChar,50),
new SqlParameter("@ProductMarketPrice", SqlDbType.NVarChar,50),
后面还有 392 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。