public int InsertRow(DbTransaction pTran, Customer Customer, bool CreateTransaction) { int intRow = 0; DbTransaction objTran = pTran; Exception exception = null; try { if (pTran == null && CreateTransaction == true) { objTran = CustomerData.CreateTransaction(); } intRow = CustomerData.InsertRow(objTran, Customer); if (pTran == null && objTran != null && CreateTransaction == true) { CustomerData.CommitTransaction(objTran, true); objTran = null; } } catch (Exception EX) { exception = EX; if (pTran == null && objTran != null && CreateTransaction == true) { CustomerData.RollbackTransaction(objTran, true); objTran = null; } } finally { } return(intRow); }