DAL/ProductTypeService.cs

(开头部分) 15KB

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

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

namespace DAL
{
	/// <summary>
	/// 数据访问类:ProductTypeService
	/// </summary>
	public partial class ProductTypeService
	{
		public ProductTypeService()
		{}
		#region  BasicMethod
        public static string GetName(object productTypeId) 
        {
            string sql = "select typeName from ProductType where id = " + productTypeId;
            object obj = DBHelperSQL.GetSingle(sql);
            if(obj != null)
            {
                return obj.ToString();
            }
            return "";
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public static bool DeleteTypeImg(int id,int num)
        {

            StringBuilder strSql = new StringBuilder();
            if(num == 1)
            {
                strSql.Append("update ProductType set imgurl = ''");
            }
            if (num == 2)
            {
                strSql.Append("update ProductType set diaryImg = ''");
            }
            if (num == 3)
            {
                strSql.Append("update ProductType set remark = ''");
            }
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4)
			};
            parameters[0].Value = id;

            int rows = DBHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
后面还有 436 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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