DAL/ProductPrice.cs

(开头部分) 12KB

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

using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using DBUtility;
namespace DAL
{
	/// <summary>
    /// 数据访问类:ProductPrice
	/// </summary>
	public partial class ProductPrice
	{
        public ProductPrice()
		{}
        #region  Method
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int Id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from ProductPrice");
            strSql.Append(" where ProId=@Id");
            SqlParameter[] parameters = {
					new SqlParameter("@Id", SqlDbType.BigInt)
			};
            parameters[0].Value = Id;

            return DbHelperSQL.Exists(strSql.ToString(), parameters);
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public long Add(Model.ProductPrice model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into ProductPrice(");
            strSql.Append("ProId,Title,Price,OriginalPrice,OriginalPriceTitle,PriceTitle)");
            strSql.Append(" values (");
            strSql.Append("@ProId,@Title,@Price,@OriginalPrice,@OriginalPriceTitle,@PriceTitle)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
					new SqlParameter("@ProId", SqlDbType.Int,4),
					new SqlParameter("@Title", SqlDbType.VarChar,100),
					new SqlParameter("@Price", SqlDbType.Decimal,9),
                    new SqlParameter("@OriginalPrice",SqlDbType.VarChar,100),
                    new SqlParameter("@OriginalPriceTitle",SqlDbType.VarChar,100),
                    new SqlParameter("@PriceTitle",SqlDbType.VarChar,100)};
            parameters[0].Value = model.ProId;
            parameters[1].Value = model.Title;
            parameters[2].Value = model.Price;
            parameters[3].Value = model.OriginalPrice;
            parameters[4].Value = model.OriginalPriceTitle;
            parameters[5].Value = model.PriceTitle;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
后面还有 270 行代码,购买后查看完整代码

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

AI 解读 AI

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

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