62 lines
2.2 KiB
C#
62 lines
2.2 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Text;
|
|||
|
using System.Data;
|
|||
|
using DBFactory;
|
|||
|
using ICommLayer;
|
|||
|
using CommLayerFactory;
|
|||
|
namespace ControlSystem
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// <20><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɨ<EFBFBD>衢<EFBFBD><E8A1A2><EFBFBD>̡<EFBFBD><CCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// <20><><EFBFBD>ͻ<EFBFBD><CDBB>ϵ<EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
public class CScanBarcode
|
|||
|
{
|
|||
|
DBOperator dbo = new DBOperator();
|
|||
|
DBOperator dboM = new DBOperator("ManConnString", "ManDBFactory");
|
|||
|
public void BarCodeApply()
|
|||
|
{
|
|||
|
IGetDeviceState gds;
|
|||
|
int[] bc;
|
|||
|
string sql = "SELECT F_DeviceIndex, F_BarCodeUse, F_BindingDevice, F_BarCode FROM T_Base_ScanBarcode order by F_DeviceIndex asc";
|
|||
|
DataView dv = dbo.ExceSQL(sql).Tables[0].DefaultView;
|
|||
|
for (int i = 0; i < dv.Count; i++)
|
|||
|
{//ɨ<>赽<EFBFBD><E8B5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<EFBFBD><CDBE>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD>ȶ<EFBFBD>
|
|||
|
switch (dv[i]["F_BarCodeUse"].ToString())
|
|||
|
{
|
|||
|
case "1":
|
|||
|
#region 1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ȫ<EBA3A8><C8AB><EFBFBD><EFBFBD><EFBFBD>㣩<EFBFBD><E3A3A9><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EBB2BB><EFBFBD>Ⱦ<EFBFBD><C8BE><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
gds = CommModeCreate.CreateGetDeviceState(Convert.ToInt32(dv[i]["F_DeviceIndex"]));
|
|||
|
bc= gds.GetDeviceState(Convert.ToInt32(dv[i]["F_DeviceIndex"]), 64777);
|
|||
|
int bcz=0;
|
|||
|
string barcode = string.Empty;
|
|||
|
for (int j = 2; j < 12; j++)
|
|||
|
{
|
|||
|
bcz = bcz + bc[j];
|
|||
|
barcode = barcode + bc[j].ToString();
|
|||
|
}
|
|||
|
if (bcz == 0)
|
|||
|
{
|
|||
|
continue;
|
|||
|
}
|
|||
|
DataView dvbc = dbo.ExceSQL("SELECT F_TxtParam FROM T_Monitor_Task WHERE (F_TxtParam = '"+barcode +"')").Tables[0].DefaultView;
|
|||
|
if (dvbc.Count > 0)
|
|||
|
{
|
|||
|
continue;
|
|||
|
}
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
#endregion
|
|||
|
break;
|
|||
|
|
|||
|
default:
|
|||
|
break;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|