AccessDAL/ProductKinds.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using MyShop.IDAL;
using MyShop.Model;
namespace MyShop.AccessDAL
{
public class ProductKinds : IProductKinds
{
private ConfigInfo configInfo = new ConfigInfo();
private string tableName = "Ljh_ProductKinds";
public ProductKinds()
{
if (!string.IsNullOrEmpty(configInfo.TablePrefix.Trim()))
tableName = configInfo.TablePrefix + "ProductKinds";
}
#region IProductKinds member
/// <summary>
///
/// </summary>
/// <param name="model"></param>
/// <returns>返回ID, 如果发生错误则返回-1</returns>
public int Add(ProductKindsInfo model)
{
if (model == null)
{
return 0;
}
string commandText = "insert into " + this.tableName + "(ProductKindName,productKindIntro,IsDisabled,OrderId) values(@ProductKindName,@productKindIntro,@IsDisabled,@OrderId) ";
OleDbParameter[] commandParameters ={
Database.MakeInParam("@ProductKindName",OleDbType.VarWChar,50,model.ProductKindName),
Database.MakeInParam("@ProductKindIntro",OleDbType.VarWChar,255,model.ProductKindIntro),
Database.MakeInParam("@IsDisabled",OleDbType.UnsignedTinyInt,1,model.IsDisabled),
Database.MakeInParam("@OrderId",OleDbType.Integer,4,model.OrderId)
};
int intIdentity = -1;
try
{
Database.ExecuteNonQuery(CommandType.Text, out intIdentity, commandText, commandParameters);
}
catch (Exception exception)
{
throw exception;
}
return intIdentity;
}
/// <summary>
/// 删除购物车项目
后面还有 186 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
