using SqlSugar;
|
using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Data.SqlClient;
|
using System.Linq;
|
using System.Text;
|
|
namespace IStation.DAL
|
{
|
/// <summary>
|
/// 数据访问类:SoftSetting
|
/// </summary>
|
public partial class SoftSetting : CorpDAL<Entity.SoftSetting>
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public override ConnectionConfig ConnectionConfig
|
{
|
get { return ConfigHelper.DefaultConnectionConfig; }
|
}
|
|
/// <summary>
|
/// 获取
|
/// </summary>
|
public Entity.SoftSetting GetBySetName(long CorpID, string SetName)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.SoftSetting>()
|
.First(x => x.CorpID == CorpID && x.SetName == SetName );
|
}
|
}
|
|
/// <summary>
|
/// 根据SetName更新
|
/// </summary>
|
public bool UpdateSetValue(long CorpID, string SetName, string SetValue)
|
{
|
using (SqlSugarClient db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Updateable<Entity.SoftSetting>()
|
.SetColumns(x => x.SetValue == SetValue)
|
.Where(x => x.CorpID == CorpID && x.SetName == SetName)
|
.ExecuteCommand() > 0;
|
}
|
}
|
|
|
}
|
}
|