日期:2014-05-17 浏览次数:20412 次
CREATE PROCEDURE ProductOrderSplit @SELL_IDSN int, @SplitNumber int AS begin tran declare @SELL_ID varchar(100) declare @OrderNoteSN int [s] sele
public int SplitProduct(int SELL_IDSN, int SplitNumber) { SqlConnection sqlConn = HunryCommon.DataAccess.GetConnection(); sqlConn.Open(); SqlTransaction sqlTrans = sqlConn.BeginTransaction(); try { SqlParameter [] commandParameters = new SqlParameter[2]; commandParameters[0] = new SqlParameter("@SELL_IDSN",SqlDbType.Int); commandParameters[0].Value = SELL_IDSN; commandParameters[1] = new SqlParameter("@SplitNumber",SqlDbType.Int); commandParameters[1].Value = SplitNumber; HunryCommon.DataAccess.ExecuteScalar(sqlTrans,CommandType.StoredProcedure,"ProductOrderSplit",commandParameters); sqlTrans.Commit(); sqlConn.Close(); return 1; } catch(SqlException ex) { string ss=ex.ToString(); sqlTrans.Rollback(); sqlConn.Close(); return 0;//有异常 } }