Robin_PC\robin 3 months ago
parent
commit
5b840d0c66
2 changed files with 14 additions and 4 deletions
  1. +6
    -0
      FireBirdUtil/SqlHelper/SqlHelper.cs
  2. +8
    -4
      WeighBusiness/BL/ProductCatalogBL.cs

+ 6
- 0
FireBirdUtil/SqlHelper/SqlHelper.cs View File

@ -100,6 +100,12 @@ namespace FireBirdUtil.SqlHelpers
string errorMessage; string errorMessage;
ExecuteNonQuery(sql, out success, out errorMessage); ExecuteNonQuery(sql, out success, out errorMessage);
} }
public string ExecuteNonQuery2(string sql, out bool success)
{
string errorMessage;
ExecuteNonQuery(sql, out success, out errorMessage);
return errorMessage;
}
public void ExecuteNonQuery(string sql, out bool success, out string errorMessage) public void ExecuteNonQuery(string sql, out bool success, out string errorMessage)
{ {


+ 8
- 4
WeighBusiness/BL/ProductCatalogBL.cs View File

@ -299,10 +299,14 @@ namespace WeighBusiness.BL
{ {
string insertSql = InsertUtil.GetInsertSql(TableNames., string insertSql = InsertUtil.GetInsertSql(TableNames.,
new string[] { "ProductCatalog_ID", "Name", "Sequence", "RowVersion" }, new string[] { "ProductCatalog_ID", "Name", "Sequence", "RowVersion" },
new string[] { catalog.ProductCatalog_ID.ToString(), catalog.ProductCatalog_ID.ToString(), catalog.Sequence.ToString(),"0" });
she.ExecuteNonQuery(insertSql, out success);
if (!success)
she.Rollback();
new string[] { catalog.ProductCatalog_ID.ToString(), catalog.ProductCatalog_ID.ToString(), catalog.Sequence == null ? "null" : catalog.Sequence.ToString(), "0" });
she.ExecuteNonQuery(insertSql, out success, out errorMessage);
if (!success)
{
throw new ApplicationException(errorMessage);
//she.Rollback();
}
} }
} }
she.Commit(); she.Commit();


Loading…
Cancel
Save