using DataEntity.Device;
|
using DataRWDAL.Base;
|
using MySql.Data.MySqlClient;
|
using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using XCommon.Log;
|
using XCommon.MySql;
|
|
namespace XImagingXhandler.XDAL
|
{
|
/// <summary>
|
/// 软件信息表 数据操作类
|
/// </summary>
|
public class SoftwareInformationDB : BaseDB
|
{
|
#region 获取当前软件信息
|
/// <summary>
|
/// 获取当前软件信息
|
/// </summary>
|
/// <param name="isAvailable">当前的设备状态</param>
|
/// <returns>当前软件匹配的设备数据</returns>
|
public static SoftwareInformation GetSoftwareInformationDataFromdb(int isAvailable)
|
{
|
using (var db = GetInstance())
|
{
|
return db.Queryable<SoftwareInformation>().Single(it => it.is_available == isAvailable);
|
}
|
}
|
#endregion
|
|
#region 更新软件信息
|
/// <summary>
|
/// 更新软件信息
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
public static int Update(SoftwareInformation model)
|
{
|
using (var db = GetInstance())
|
{
|
return db.Updateable<SoftwareInformation>(model).ExecuteCommand();
|
}
|
}
|
#endregion
|
|
#region 更新软件信息
|
/// <summary>
|
/// 更新软件信息
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
public static int UpdateSpeed(SoftwareInformation model)
|
{
|
using (var db = GetInstance())
|
{
|
return db.Updateable(model).UpdateColumns(it => it.global_speed).Where(x=>x.software_information_id.Equals(model.software_information_id)).ExecuteCommand();
|
}
|
}
|
#endregion
|
}
|
}
|