DAL/ProductPKService.cs

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;

namespace DAL
{
	/// <summary>
	/// 数据访问类:ProductPKService
	/// </summary>
	public partial class ProductPKService
	{
		public ProductPKService()
		{}
		#region  BasicMethod
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		public bool Exists(int id)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select count(1) from ProductPK");
			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 int Add(Model.ProductPK model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into ProductPK(");
			strSql.Append("productId,quantiyCount,brandCount,priceCount,configCount,appearanceCount,otherCount)");
			strSql.Append(" values (");
			strSql.Append("@productId,@quantiyCount,@brandCount,@priceCount,@configCount,@appearanceCount,@otherCount)");
			strSql.Append(";select @@IDENTITY");
			SqlParameter[] parameters = {
					new SqlParameter("@productId", SqlDbType.Int,4),
					new SqlParameter("@quantiyCount", SqlDbType.Int,4),
					new SqlParameter("@brandCount", SqlDbType.Int,4),
					new SqlParameter("@priceCount", SqlDbType.Int,4),
					new SqlParameter("@configCount", SqlDbType.Int,4),
					new SqlParameter("@appearanceCount", SqlDbType.Int,4),
					new SqlParameter("@otherCount", SqlDbType.Int,4)};
			parameters[0].Value = model.productId;
			parameters[1].Value = model.quantiyCount;
			parameters[2].Value = model.brandCount;
			parameters[3].Value = model.priceCount;
			parameters[4].Value = model.configCount;
			parameters[5].Value = model.appearanceCount;
			parameters[6].Value = model.otherCount;

			object obj = DBHelperSQL.GetSingle(strSql.ToString(),parameters);
后面还有 283 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。