mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-05-18 19:48:23 +00:00
37 lines
1021 B
C#
37 lines
1021 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.Data.SqlClient;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace bnhtrade.Core.Data.Database.Stock
|
|
{
|
|
public class DeleteSkuTransaction : Connection
|
|
{
|
|
public DeleteSkuTransaction ()
|
|
{
|
|
}
|
|
|
|
public void ByTransactionId(int skuReconcileId)
|
|
{
|
|
using (var conn = new SqlConnection(SqlConnectionString))
|
|
{
|
|
conn.Open();
|
|
|
|
using (SqlCommand cmd = new SqlCommand(@"
|
|
DELETE FROM tblStockSkuTransaction WHERE StockSkuTransactionID = @transactionId
|
|
", conn))
|
|
{
|
|
cmd.Parameters.AddWithValue("@transactionId", skuReconcileId);
|
|
|
|
if (cmd.ExecuteNonQuery() < 1)
|
|
{
|
|
throw new Exception("Delete sku transaction effected no records");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|