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