SCLS/SSWCS_JXDL(2019)/BarcodeCheck/CBarcodeCheck.cs
2025-05-19 09:45:29 +08:00

50 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using DBFactory;
using ICommLayer;
using CommLayerFactory;
namespace BarcodeCheck
{
public class CBarcodeCheck
{
public static IGetDeviceState cds;//20100127
public static DBOperator dbo = new DBOperator();
public static bool BarCodeCheck(int taskIndex, int deviceIndex, string barcode)
{
int[] ret;//20100127
try
{
//20100127
cds = CommModeCreate.CreateGetDeviceState(deviceIndex);
//ret[0]ÈÎÎñºÅ ret[1]É豸Ë÷Òý
//20100127
ret = cds.GetDeviceState(deviceIndex, taskIndex);
string bc = string.Empty;
for (int i = 2; i < 12; i++)
{
bc = bc + Convert.ToString(ret[i]);
}
if (bc == barcode)
{
return true;
}
else
{
return false;
}
}
catch (Exception ex)
{//20100127
throw ex;
}
finally
{//20100127
ret = null;
}
}
}
}