DAL/Product_ProperValueService.cs

(开头部分) 10KB

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

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

namespace DAL
{
	/// <summary>
	/// 数据访问类:Product_ProperValueService
	/// </summary>
	public partial class Product_ProperValueService
	{
		public Product_ProperValueService()
		{}
		#region  BasicMethod
        /// <summary>
        /// 根据产品ID和属性ID获取对象
        /// </summary>
        /// <param name="productId"></param>
        /// <param name="properId"></param>
        /// <returns></returns>
        public static Product_ProperValue GetModel(int productId, int properId)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 id,productId,properValueId,properValueText,properId,parentId from Product_ProperValue ");
            strSql.Append(" where productId=@productId and properId=@properId");
            SqlParameter[] parameters = {
					new SqlParameter("@productId", SqlDbType.Int,4),new SqlParameter("@properId",SqlDbType.Int,4)
			};
            parameters[0].Value = productId;
            parameters[1].Value = properId;
            Model.Product_ProperValue model = new Model.Product_ProperValue();
            DataSet ds = DBHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }
        /// <summary>
        /// 删除已有的记录插入新的记录
        /// </summary>
        /// <param name="?"></param>
        /// <param name="?"></param>
        /// <param name="?"></param>
        /// <returns></returns>
        public static int Delete(int productId,int parentId,int properId)
        {
            string sql = "delete from Product_ProperValue where productId = " + productId + " and parentId = " + parentId + " and properId = " + properId;
            return DBHelperSQL.ExecuteSql(sql);
        }

		/// <summary>
		/// 是否存在该记录
		/// </summary>
        public static bool Exists(int productId, int properValueId)
后面还有 306 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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