namespace Yw.DAL.SQLite
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public partial class BimfaceFile : BaseTraceDAL_Paras_Flags_TagName_Sorter<Entity.BimfaceFile>, IBimfaceFile
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public override ConnectionConfig ConnectionConfig
|
{
|
get { return ConfigHelper.SQLiteConnectionConfig; }
|
|
}
|
|
/// <summary>
|
/// 更新 FileStatus
|
/// </summary>
|
public bool UpdateFileStatus(long ID, int FileStatus)
|
{
|
using (SqlSugarClient db = new(ConnectionConfig))
|
{
|
return db.Updateable<Entity.BimfaceFile>()
|
.SetColumns(x => x.FileStatus == FileStatus)
|
.SetColumns(x => x.UpdateUserID == UserRegister.UserID)
|
.SetColumns(x => x.UpdateTime == DateTime.Now)
|
.SetColumns(x => x.UpdateUserName == UserRegister.UserName)
|
.Where(x => x.ID == ID)
|
.ExecuteCommandHasChange();
|
}
|
}
|
|
/// <summary>
|
/// 更新 Content
|
/// </summary>
|
public bool UpdateContent(long ID, string Content)
|
{
|
using (SqlSugarClient db = new(ConnectionConfig))
|
{
|
return db.Updateable<Entity.BimfaceFile>()
|
.SetColumns(x => x.Content == Content)
|
.SetColumns(x => x.UpdateUserID == UserRegister.UserID)
|
.SetColumns(x => x.UpdateTime == DateTime.Now)
|
.SetColumns(x => x.UpdateUserName == UserRegister.UserName)
|
.Where(x => x.ID == ID)
|
.ExecuteCommandHasChange();
|
}
|
}
|
|
|
/// <summary>
|
/// 通过 ID 删除(同时删除标签)
|
/// </summary>
|
public bool DeleteExByID(long ID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
try
|
{
|
db.BeginTran();
|
var bol = db.Deleteable<Entity.BimfaceFile>().Where(x => x.ID == ID).ExecuteCommandHasChange();
|
if (!bol)
|
{
|
db.RollbackTran();
|
return false;
|
}
|
db.Deleteable<Entity.BimfaceFileLabel>().Where(x => x.BimfaceFileID == ID).ExecuteCommandHasChange();
|
db.CommitTran();
|
return true;
|
}
|
catch
|
{
|
db.RollbackTran();
|
throw;
|
}
|
}
|
}
|
|
|
|
|
}
|
}
|