init: 导入项目到 meswork Gitea
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
using System.Data.OleDb;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 机床加工时间
|
||||
/// </summary>
|
||||
public partial class QualityDataSystem
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 从Access 数据库获得,报警变量基本文本
|
||||
/// </summary>
|
||||
public static bool PLC_MSMsgs_WORKSelect(out DataTable dt)
|
||||
{
|
||||
string sql = "SELECT * FROM [MES_基本变量_报警报文] ";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// INSERT INTO [测量数据报警全部]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static void AlarmStartAllInsert(DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "INSERT INTO [测量数据报警全部]"
|
||||
+ "(AlarmID,TagID, TagValue, MsgNr, State,alarmStartTime,alarmEndTime,TimeDiff,TypeName,Text1, Text2,lastupdatetime)"
|
||||
|
||||
+ "VALUES(@AlarmID,@TagID,@TagValue,@MsgNr,@State,@alarmStartTime,@alarmEndTime,@TimeDiff,@TypeName,@Text1,@Text2,@lastupdatetime)";
|
||||
|
||||
|
||||
OleDbParameter[] thisParmsAccess = new OleDbParameter[12];
|
||||
thisParmsAccess[0] = new OleDbParameter("@AlarmID", OleDbType.Integer, 4, "AlarmID");
|
||||
thisParmsAccess[1] = new OleDbParameter("@TagID", OleDbType.Integer, 4, "TagID");
|
||||
thisParmsAccess[2] = new OleDbParameter("@TagValue", OleDbType.Integer, 4, "TagValue");
|
||||
thisParmsAccess[3] = new OleDbParameter("@MsgNr", OleDbType.Integer, 4, "MsgNr");
|
||||
thisParmsAccess[4] = new OleDbParameter("@State", OleDbType.Integer, 4, "State");
|
||||
thisParmsAccess[5] = new OleDbParameter("@alarmStartTime", OleDbType.Date, 8, "alarmStartTime");
|
||||
thisParmsAccess[6] = new OleDbParameter("@alarmEndTime", OleDbType.Date, 8, "alarmEndTime");
|
||||
thisParmsAccess[7] = new OleDbParameter("@TimeDiff", OleDbType.Integer, 4, "TimeDiff");
|
||||
thisParmsAccess[8] = new OleDbParameter("@TypeName", OleDbType.VarChar, 50, "TypeName");
|
||||
thisParmsAccess[9] = new OleDbParameter("@Text1", OleDbType.VarChar, 50, "Text1");
|
||||
thisParmsAccess[10] = new OleDbParameter("@Text2", OleDbType.VarChar, 50, "Text2");
|
||||
thisParmsAccess[11] = new OleDbParameter("@lastupdatetime", OleDbType.Date, 8, "lastupdatetime");
|
||||
//
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[12];
|
||||
thisParmsSql[0] = new SqlParameter("@AlarmID", SqlDbType.Int, 4, "AlarmID");
|
||||
thisParmsSql[1] = new SqlParameter("@TagID", SqlDbType.Int, 4, "TagID");
|
||||
thisParmsSql[2] = new SqlParameter("@TagValue", SqlDbType.Int, 4, "TagValue");
|
||||
thisParmsSql[3] = new SqlParameter("@MsgNr", SqlDbType.Int, 4, "MsgNr");
|
||||
thisParmsSql[4] = new SqlParameter("@State", SqlDbType.Int, 4, "State");
|
||||
thisParmsSql[5] = new SqlParameter("@alarmStartTime", SqlDbType.DateTime, 8, "alarmStartTime");
|
||||
thisParmsSql[6] = new SqlParameter("@alarmEndTime", SqlDbType.DateTime, 8, "alarmEndTime");
|
||||
thisParmsSql[7] = new SqlParameter("@TimeDiff", SqlDbType.Int, 4, "TimeDiff");
|
||||
thisParmsSql[8] = new SqlParameter("@TypeName", SqlDbType.NVarChar, 50, "TypeName");
|
||||
thisParmsSql[9] = new SqlParameter("@Text1", SqlDbType.NVarChar, 50, "Text1");
|
||||
thisParmsSql[10] = new SqlParameter("@Text2", SqlDbType.NVarChar, 50, "Text2");
|
||||
thisParmsSql[11] = new SqlParameter("@lastupdatetime", SqlDbType.DateTime, 8, "lastupdatetime");
|
||||
|
||||
if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
DataAccess.ExecuteSQL(sql, ref thisParmsSql, dt);
|
||||
}
|
||||
if (!SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParmsAccess);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user