YKT_DAL/DALProductClass.cs

(开头部分) 13KB

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

using System;
using System.Collections.Generic;

using System.Text;
using YKT.DBUtility;
using System.Data.SqlClient;
using YKT_Model;
using System.Data;

namespace YKT_DAL
{
    public class DALProductClass
    {

        #region  成员方法

        /// <summary>
        /// 得到最大ID
        /// </summary>
        public int GetMaxId()
        {
            return DbHelperSQL.GetMaxID("ClassID", "YKT_ProductClass");
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int ClassID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from YKT_ProductClass");
            strSql.Append(" where ClassID=@ClassID ");
            SqlParameter[] parameters = {
					new SqlParameter("@ClassID", SqlDbType.Int,4)};
            parameters[0].Value = ClassID;

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


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(ModelProductClass model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into YKT_ProductClass(");
            strSql.Append("ClassID,ChannelID,ClassName,Child,Depth,OrderID,ParentID,RootID,ParentPath,ReadMe,ClassDescription,ClassKeywords,AddDateTime,ShowOrder,IsShow)");
            strSql.Append(" values (");
            strSql.Append("@ClassID,@ChannelID,@ClassName,@Child,@Depth,@OrderID,@ParentID,@RootID,@ParentPath,@ReadMe,@ClassDescription,@ClassKeywords,@AddDateTime,@ShowOrder,@IsShow)");
            SqlParameter[] parameters = {
					new SqlParameter("@ClassID", SqlDbType.Int,4),
					new SqlParameter("@ChannelID", SqlDbType.Int,4),
					new SqlParameter("@ClassName", SqlDbType.VarChar,255),
					new SqlParameter("@Child", SqlDbType.Int,4),
					new SqlParameter("@Depth", SqlDbType.Int,4),
					new SqlParameter("@OrderID", SqlDbType.Int,4),
					new SqlParameter("@ParentID", SqlDbType.Int,4),
					new SqlParameter("@RootID", SqlDbType.Int,4),
					new SqlParameter("@ParentPath", SqlDbType.VarChar,255),
后面还有 261 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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