QiFeng.ZWY.Dal/CommoditySpecifications.cs

(开头部分) 9KB

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

using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using QiFeng.LMSD.DBUtility;
using QiFeng.LMSD.Model;
using QiFeng.LMSD.Model.Dto;
using System.Linq;

namespace QiFeng.LMSD.Dal
{
    public partial class CommoditySpecificationsDal : BaseDal<CommoditySpecificationsDal>
    {
        #region 默认方法
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(CommoditySpecifications model)
        {
            var strSql = new StringBuilder();
            strSql.Append("insert into CommoditySpecifications(");
            strSql.Append("CommodityId,SpecificationsName,SpecificationsValue,SpecificationsSuffix,AddDate,AddMcAccountId,IsDelete");
            strSql.Append(") values (");
            strSql.Append("@CommodityId,@SpecificationsName,@SpecificationsValue,@SpecificationsSuffix,@AddDate,@AddMcAccountId,@IsDelete");
            strSql.Append(") ");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                        new SqlParameter("@CommodityId", SqlDbType.Int,4) ,
                        new SqlParameter("@SpecificationsName", SqlDbType.NVarChar,50) ,
                        new SqlParameter("@SpecificationsValue", SqlDbType.NVarChar,100) ,
                        new SqlParameter("@SpecificationsSuffix", SqlDbType.NVarChar,50) ,
                        new SqlParameter("@AddDate", SqlDbType.DateTime) ,
                        new SqlParameter("@AddMcAccountId", SqlDbType.Int,4) ,
                        new SqlParameter("@IsDelete", SqlDbType.Bit,1)

            };

            parameters[0].Value = model.CommodityId;
            parameters[1].Value = model.SpecificationsName;
            parameters[2].Value = model.SpecificationsValue;
            parameters[3].Value = model.SpecificationsSuffix;
            parameters[4].Value = model.AddDate;
            parameters[5].Value = model.AddMcAccountId;
            parameters[6].Value = model.IsDelete;
            var obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            return obj == null ? 0 : Convert.ToInt32(obj);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(CommoditySpecifications model)
        {
            var strSql = new StringBuilder();
            strSql.Append("update CommoditySpecifications set ");

            strSql.Append(" CommodityId = @CommodityId , ");
            strSql.Append(" SpecificationsName = @SpecificationsName , ");
            strSql.Append(" SpecificationsValue = @SpecificationsValue , ");
后面还有 152 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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