|
|
@@ -999,7 +999,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
- connection= new OracleConnection(DBConnectionString);
|
|
|
+ connection = new OracleConnection(DBConnectionString);
|
|
|
connection.Open();
|
|
|
command.Connection = connection;
|
|
|
command.ExecuteNonQuery();
|
|
|
@@ -1109,6 +1109,49 @@ namespace UAS_LabelMachine
|
|
|
command.Dispose();
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 调用存储过程
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="ProcedureName"></param>
|
|
|
+ /// <param name="param"></param>
|
|
|
+ public void CallProcedure(string ProcedureName, DataTable upload, out string pibid)
|
|
|
+ {
|
|
|
+ StringBuilder sql = new StringBuilder();
|
|
|
+ pibid = "";
|
|
|
+ sql.Append("declare barcode BarCodeUpload_arr;begin barcode:=BarCodeUpload_arr(");
|
|
|
+ for (int i = 0; i < upload.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ //特殊语句,传递回拼接的ID给到跟新本地数据
|
|
|
+ pibid += upload.Rows[i]["pib_id"].ToString() + ",";
|
|
|
+ sql.Append("BarCodeUpload(");
|
|
|
+ for (int j = 0; j < upload.Columns.Count; j++)
|
|
|
+ {
|
|
|
+ sql.Append("'" + upload.Rows[i][j].ToString() + "',");
|
|
|
+ }
|
|
|
+ sql.Remove(sql.Length - 1, 1);
|
|
|
+ sql.Append("),");
|
|
|
+ }
|
|
|
+ pibid += 0;
|
|
|
+ sql.Remove(sql.Length - 1, 1);
|
|
|
+ sql.Append(");sp_uploadbarcode(barcode);END;");
|
|
|
+ command = new OracleCommand();
|
|
|
+ command.Connection = connection;
|
|
|
+ command.CommandText = sql.ToString();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ command.ExecuteNonQuery();
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ connection = new OracleConnection(DBConnectionString);
|
|
|
+ connection.Open();
|
|
|
+ command.Connection = connection;
|
|
|
+ command.ExecuteNonQuery();
|
|
|
+ }
|
|
|
+ command.Dispose();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 调用存储过程
|
|
|
/// </summary>
|
|
|
@@ -1120,6 +1163,7 @@ namespace UAS_LabelMachine
|
|
|
sql.Append("declare barcode BarCodeUpload_arr;begin barcode:=BarCodeUpload_arr(");
|
|
|
for (int i = 0; i < upload.Rows.Count; i++)
|
|
|
{
|
|
|
+ //特殊语句,传递回拼接的ID给到跟新本地数据
|
|
|
sql.Append("BarCodeUpload(");
|
|
|
for (int j = 0; j < upload.Columns.Count; j++)
|
|
|
{
|
|
|
@@ -1195,7 +1239,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
- connection = new OracleConnection(DBConnectionString);
|
|
|
+ connection = new OracleConnection(DBConnectionString);
|
|
|
connection.Open();
|
|
|
command.Connection = connection;
|
|
|
command.ExecuteNonQuery();
|