111,129
社区成员
发帖
与我相关
我的任务
分享private bool CheckID(string lpn, string shipment_id)
{
bool isgood = false;
SqlConnection con = new SqlConnection("");
con.Open();
SqlCommand com = new SqlCommand("select internal_shipment_num from shipping_container where container_id='" + lpn + "'", con);
SqlCommand comm = new SqlCommand("select internal_shipment_num from shipment_header where shipment_id='" + shipment_id + "'", con);
try
{
object i = com.ExecuteScalar();
object t = comm.ExecuteScalar();
if (i == DBNull.Value || i == null || t == DBNull.Value || t == null)
{
isgood = false;
}
else
{
isgood = (i.ToString() == t.ToString());
}
}
catch
{
isgood = false;
}
finally
{
con.Close();
}
return isgood;
}