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.
52 lines
1.5 KiB
52 lines
1.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Data.SqlClient;
|
|
using System.Data;
|
|
|
|
namespace Stone.WinBiz.SystemData
|
|
{
|
|
public class F_RFID
|
|
{
|
|
public static string GetRfid(string rfid)
|
|
{
|
|
string ret = "";
|
|
|
|
SqlConnection conn = new System.Data.SqlClient.SqlConnection(GetConnString());
|
|
try
|
|
{
|
|
conn.Open();
|
|
|
|
string sql = "select n_PaintMCode as U9PaintNo from tWorkLog where n_state=1 and s_PaintTID='" + rfid + "' order by n_WorkLogId desc";
|
|
SqlDataAdapter sda = new SqlDataAdapter(sql, conn);
|
|
|
|
DataSet dsData = new DataSet();
|
|
sda.Fill(dsData);
|
|
|
|
if (dsData.Tables[0].Rows.Count == 0)
|
|
{
|
|
throw new Exception("未取到 " + rfid + " 的数据");
|
|
}
|
|
|
|
ret = dsData.Tables[0].Rows[0]["U9PaintNo"].ToString();
|
|
return ret;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
if (conn.State == System.Data.ConnectionState.Open) conn.Close();
|
|
}
|
|
|
|
}
|
|
|
|
public static string GetConnString()
|
|
{
|
|
Entity.Entity_t_Sys_Appconfig t_Sys_Appconfig = new Entity.Entity_t_Sys_Appconfig();
|
|
return t_Sys_Appconfig.GetData("[Code]='RFID'").Tables[0].Rows[0]["Value"].ToString();
|
|
}
|
|
}
|
|
}
|
|
|