SuLei.DAL/sl_site_channel.cs
(开头部分) 34KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Reflection;
using System.Text;
using SuLei.DBUtility;
using SuLei.Common;
namespace SuLei.DAL
{
/// <summary>
/// 数据访问类:系统频道表
/// </summary>
public partial class sl_site_channel
{
private string databaseprefix;//数据库表名前缀
public sl_site_channel(string _databaseprefix)
{
databaseprefix = _databaseprefix;
}
#region 基本方法================================
/// <summary>
/// 是否存在该记录
/// </summary>
public bool Exists(int id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select count(1) from " + databaseprefix + "site_channel");
strSql.Append(" where id=@id");
SqlParameter[] parameters = {
new SqlParameter("@id", SqlDbType.Int,4)};
parameters[0].Value = id;
return DbHelperSQL.Exists(strSql.ToString(), parameters);
}
/// <summary>
/// 增加一条数据及其子表
/// </summary>
public int Add(Model.sl_site_channel model)
{
//取得站点对应的导航,如果站点导航不存在则退出新增
int parent_id = new DAL.sl_sites(databaseprefix).GetSiteNavId(model.site_id);
if (parent_id == 0)
{
return 0;
}
using (SqlConnection conn = new SqlConnection(DbHelperSQL.connectionString))
{
conn.Open(); //打开数据连接
using (SqlTransaction trans = conn.BeginTransaction())
{
try
{
#region 写入频道表数据==================
StringBuilder strSql = new StringBuilder();
StringBuilder str1 = new StringBuilder();//数据字段
后面还有 660 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
