public void Elimina(VendorContactBE pItem) { try { VendorContactDL VendorContact = new VendorContactDL(); VendorContact.Elimina(pItem); } catch (Exception ex) { throw ex; } }
public void Elimina(VendorBE pItem) { try { using (TransactionScope ts = new TransactionScope()) { VendorDL Vendor = new VendorDL(); VendorAddressDL VendorAddress = new VendorAddressDL(); VendorContactDL VendorContact = new VendorContactDL(); VendorClassificationDL VendorClassification = new VendorClassificationDL(); List <VendorAddressBE> lstVendorAddress = null; lstVendorAddress = new VendorAddressDL().ListaTodosActivo(pItem.IdVendor); foreach (var item in lstVendorAddress) { VendorAddress.Elimina(item); } List <VendorContactBE> lstVendorContact = null; lstVendorContact = new VendorContactDL().ListaTodosActivo(pItem.IdVendor); foreach (var item in lstVendorContact) { VendorContact.Elimina(item); } List <VendorClassificationBE> lstVendorClassification = null; lstVendorClassification = new VendorClassificationDL().ListaTodosActivo(pItem.IdVendor); foreach (var item in lstVendorClassification) { VendorClassification.Elimina(item); } Vendor.Elimina(pItem); ts.Complete(); } } catch (Exception ex) { throw ex; } }