DA/DBStorehouseType.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;
using System.Text;
using Common;
using System.Data;
using System.Data.SqlClient;
namespace DA
{
   public class DBStorehouseType:IDisposable 
    {
       string sql;
        SqlHelpers sqlh;
        SqlDataReader dr;

        public DBStorehouseType()
        {
            sqlh=new SqlHelpers ();
        }
       public DBStorehouseType(SqlHelpers  sh)
        {
            sqlh = sh;
        }

        public void Dispose()
        {
            sqlh.Dispose();
        }

       /// <summary>
        ///DB 查询所有仓库类型的方法
       /// </summary>
       /// <returns></returns>
       public List<CStorehouseType> DBStorehouseTypeQuery()
       {
           List<CStorehouseType> lst = new List<CStorehouseType>();
           sql = "select * from StorehouseType";
           dr = sqlh.RQuery(sql,null ,CommandType.Text  );
           while (dr.Read())
           {
               CStorehouseType crt = new CStorehouseType();
               crt.CstId1 = Convert.ToInt32(dr["stId"]);
               crt.CstName1 = dr["stName"].ToString();
               lst.Add(crt);
           }
           dr.Close();
           return lst;
       }

       /// <summary>
       /// DB  插入仓库类型的方法
       /// </summary>
       /// <param name="stName">仓库名称</param>
       public void DBStorehouseTypeInsert(string stName)
       {
           List<SqlParameter> pars = new List<SqlParameter>();
           pars.Add(new SqlParameter("@stName", SqlDbType.VarChar, 20));
           pars[0].Value = stName;
           sql = "insert into StorehouseType values(@stName)";
           sqlh.NonQuery(sql,pars ,CommandType .Text );
       }
后面还有 50 行代码,购买后查看完整代码

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

AI 解读 AI

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

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