DAL/DAO/Logistics_Car_TypeDAO.cs

(开头部分) 6KB

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

// ******************************************************************
// 文件名: Logistics_CarTypeDAO.cs
// 主要内容: 操作车辆类型对象的方法集合
// ******************************************************************

using System;
using System.Collections.Generic;
using Logistics.IDal;
using Logistics.Model;
using System.Data;
using System.Text;
using System.Data.SqlClient;

namespace Logistics.DAL.DAO
{

 public  class Logistics_Car_TypeDAO : IDao
    {
        #region IDao 成员

        public SqlConnection connection { get; set; }

        public SqlTransaction transaction { get; set; }

        /// <summary>
        /// 添加一个对象
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public int add(object m)
        {
            Logistics_Car_Type model = m as Logistics_Car_Type;
            int rowsAffected;
            SqlParameter[] parameters = {
					new SqlParameter("@CP_ID", SqlDbType.Int,4),
					new SqlParameter("@CP_Name", SqlDbType.NVarChar,20),
					new SqlParameter("@CP_volume", SqlDbType.Float,8),
					new SqlParameter("@CP_weight", SqlDbType.Float,8),
					new SqlParameter("@CP_Remark", SqlDbType.NText)};
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value = model.CP_Name;
            parameters[2].Value = model.CP_volume;
            parameters[3].Value = model.CP_weight;
            parameters[4].Value = model.CP_Remark;

            rowsAffected = SqlUtil.executeProcInt("UP_Logistics_Car_Type_ADD", parameters, connection, transaction);
            return (int)parameters[0].Value;
        }

        /// <summary>
        /// 通过指定属性得到实体对象列表
        /// </summary>
        /// <param name="attribute"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public DataTable getModelListByAttribute(string attribute, string value)
        {
            DataTable lo = new DataTable();
            string where = attribute + "='" + value + "'";
            lo = getModelList(-1, where,null);
后面还有 126 行代码,购买后查看完整代码

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

AI 解读 AI

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

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