You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.6 KiB
47 lines
1.6 KiB
using DyeingComputer.ViewModel;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using static DyeingComputer.UserClass.SqliteHelper;
|
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
|
|
|
|
namespace DyeingComputer.UserClass
|
|
{
|
|
public class ERRinf
|
|
{
|
|
public static void ERRinf_i(DataTable dataTable)
|
|
{
|
|
dataTable.Columns.Add("ID", Type.GetType("System.String"));
|
|
dataTable.Columns.Add("INF", Type.GetType("System.String"));
|
|
dataTable.Columns.Add("Time", Type.GetType("System.String"));
|
|
}
|
|
public static void ERRinf_w(DataTable dataTable,string dat,string ID)//写入
|
|
{
|
|
int i = dataTable.Select("INF='" + dat+ "'").Length;
|
|
if (i == 0)
|
|
{
|
|
dataTable.Rows.Add(ID,dat, DateTime.Now.ToString("yyMMddHHmmss"));
|
|
APILog.ERRlog(MainWindowViewModel.WorkNumder.ToString(),ID,dat, DateTime.Now.ToString("yy_MM_dd_HH:mm:ss"));
|
|
}
|
|
}
|
|
public static void ERRinf_d(DataTable dataTable, string dat)//删除
|
|
{
|
|
int i = dataTable.Select("ID='" + dat + "'").Length;
|
|
if (i != 0)
|
|
{
|
|
dataTable.Rows.Remove(dataTable.Select("ID='" + dat + "'").First());
|
|
}
|
|
}
|
|
|
|
public static int i=0;
|
|
public static string ERRinf_r(DataTable dataTable)//读取
|
|
{
|
|
if (i < 0) { i = dataTable.Rows.Count - 1; }
|
|
string index = dataTable.Rows[i].Field<string>("INF");
|
|
i--;
|
|
return index;
|
|
}
|
|
}
|
|
}
|
|
|