internal int Insert(Models.OrganizacionComercial oOrganizacionComercial) { Guid methodOwnerID = new Guid("37d0282a-d3d0-41cc-bb8a-f683e97daceb"); OpenDbConn(); if (cDblib.Transaction.ownerID.Equals(new Guid())) { cDblib.beginTransaction(methodOwnerID); } try { DAL.OrganizacionComercial cOrganizacionComercial = new DAL.OrganizacionComercial(cDblib); int idOrganizacionComercial = cOrganizacionComercial.Insert(oOrganizacionComercial); //Finalizar transacción if (cDblib.Transaction.ownerID.Equals(methodOwnerID)) { cDblib.commitTransaction(methodOwnerID); } return(idOrganizacionComercial); } catch (Exception ex) { //rollback if (cDblib.Transaction.ownerID.Equals(methodOwnerID)) { cDblib.rollbackTransaction(methodOwnerID); } throw ex; } }