using HMI.AlarmInfoManage.Entity;
|
using HMI.Core.Entity;
|
using HMI.Core.Util;
|
using System.Collections.ObjectModel;
|
using System.Data;
|
using System.IO;
|
|
namespace HMI.AlarmInfoManage.Model
|
{
|
public class UIModel : NotifyBase
|
{
|
public SqliteHelper sqliteHelper;
|
|
private ObservableCollection<AlarmSetting> datasource;
|
|
public ObservableCollection<AlarmSetting> Datasource
|
{
|
get { return datasource; }
|
set { Set(ref datasource, value); }
|
}
|
|
public UIModel(string filePath)
|
{
|
if (!File.Exists(filePath))
|
{
|
SqliteHelper.CreateDatabase(filePath);
|
}
|
sqliteHelper = new SqliteHelper(filePath);
|
}
|
|
public void LoadData() {
|
ObservableCollection<AlarmSetting> list = new ObservableCollection<AlarmSetting>();
|
DataTable dt = sqliteHelper.GetDataTable("SELECT * FROM alerm_setting;");
|
|
}
|
}
|
}
|