DA/DBProductType.cs

(开头部分) 6KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common;
using System.Data;
using System.Data.SqlClient;

namespace DA
{
    public class DBProductType : IDisposable
    {
        string sql;
        SqlHelpers sqlh;
        DataSet ds;
        SqlDataReader dr;
        public DBProductType()
        {
            sqlh = new SqlHelpers();
        }
        public DBProductType(SqlHelpers sh)
        {
            sqlh = sh;
        }
        public void Dispose()
        {
            sqlh.Dispose();
        }
        /// <summary>
        /// DB------查询所有产品类别
        /// </summary>
        /// <returns></returns>
        public List<CProductType> DBProductTypeQU()
        {
            List<CProductType> LPT = new List<CProductType>();
            sql = "select * from ProductType order by ProductTypeName";
            dr = sqlh.RQuery(sql, null, CommandType.Text);
            while (dr.Read())
            {
                CProductType cpt = new CProductType();
                cpt.ProductTypeID1 = Convert.ToInt32(dr["ProductTypeID"]);
                cpt.ProductTypeName1 = dr["ProductTypeName"].ToString();
                cpt.Comments1 = dr["Comments"].ToString();
                cpt.StoreID1 = Convert.ToInt32(dr["StoreID"]);
                cpt.CreateUserID1 =dr["CreateUserID"].ToString();
                cpt.CreateDateTime1 = Convert.ToDateTime(dr["CreateDateTime"]);
                LPT.Add(cpt);
            }
            dr.Close();
            return LPT;
        }
        //查询
        public List<CProductType> DBProductTypeQuery()
        {

            List<CProductType> lcp = new List<CProductType>();
            sql = "select ProductTypeID,ProductTypeName from ProductType";
            dr = sqlh.RQuery(sql, null, CommandType.Text);
            while (dr.Read())
            {
后面还有 96 行代码,购买后查看完整代码

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

AI 解读 AI

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

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