DAL/BrandService.cs

(开头部分) 13KB

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

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

namespace DAL
{
	/// <summary>
	/// 数据访问类:BrandService
	/// </summary>
	public partial class BrandService
	{
		public BrandService()
		{}
		#region  BasicMethod
        /// <summary>
        /// 更新推广状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public static int UpdateStatus(int id,int status)
        {
            string sql = "update Brand set status = " + status + " where id = " + id;
            return DBHelperSQL.ExecuteSql(sql);
        }
		/// <summary>
		/// 是否存在该记录
		/// </summary>
        public static bool Exists(Model.Brand model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select count(1) from Brand");
            strSql.Append(" where brandName=@brandName and infoType=@infoType");
			SqlParameter[] parameters = {
					new SqlParameter("@brandName", SqlDbType.VarChar,104),new SqlParameter("@infoType", SqlDbType.Int,4)
			};
            parameters[0].Value = model.brandName;
            parameters[1].Value = model.infoType;

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


		/// <summary>
		/// 增加一条数据
		/// </summary>
		public static int Add(Model.Brand model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into Brand(");
			strSql.Append("brandName,brandNameEn,brandValue,mainProduct,country,website,baseInfo,imgURL,imgSize,height,width,ispromote,status,remark,addTime,addUser,infoType)");
			strSql.Append(" values (");
			strSql.Append("@brandName,@brandNameEn,@brandValue,@mainProduct,@country,@website,@baseInfo,@imgURL,@imgSize,@height,@width,@ispromote,@status,@remark,@addTime,@addUser,@infoType)");
			strSql.Append(";select @@IDENTITY");
			SqlParameter[] parameters = {
					new SqlParameter("@brandName", SqlDbType.VarChar,50),
					new SqlParameter("@brandNameEn", SqlDbType.VarChar,50),
					new SqlParameter("@brandValue", SqlDbType.Int,4),
					new SqlParameter("@mainProduct", SqlDbType.VarChar,150),
后面还有 374 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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