DTcms.DAL/download_attach.cs
(开头部分) 8KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using DTcms.DBUtility;
using DTcms.Common;
namespace DTcms.DAL
{
/// <summary>
/// 下载附件
/// </summary>
public partial class download_attach
{
public download_attach()
{ }
#region Method
/// <summary>
/// 是否存在该记录
/// </summary>
public bool Exists(int id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select count(1) from dt_download_attach");
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 void UpdateField(int id, string strValue)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update dt_download_attach set " + strValue);
strSql.Append(" where id=" + id);
DbHelperSQL.ExecuteSql(strSql.ToString());
}
/// <summary>
/// 查找不存在的文件并删除已删除的附件及数据
/// </summary>
public void DeleteList(SqlConnection conn, SqlTransaction trans, List<Model.download_attach> models, int article_id)
{
StringBuilder idList = new StringBuilder();
if (models != null)
{
foreach (Model.download_attach modelt in models)
{
if (modelt.id > 0)
{
idList.Append(modelt.id + ",");
}
}
}
后面还有 149 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
