public void Actualiza(VendorBE pItem, List <VendorAddressBE> pListaVendorAddress, List <VendorContactBE> pListaVendorContact, List <VendorClassificationBE> pListaVendorClassification) { try { using (TransactionScope ts = new TransactionScope()) { VendorDL Vendor = new VendorDL(); VendorAddressDL VendorAddress = new VendorAddressDL(); VendorContactDL VendorContact = new VendorContactDL(); VendorClassificationDL VendorClassification = new VendorClassificationDL(); foreach (var item in pListaVendorAddress) { if (item.TipoOper == Convert.ToInt32(Operacion.Nuevo)) //Nuevo { item.IdVendor = pItem.IdVendor; VendorAddress.Inserta(item); } else { VendorAddress.Actualiza(item); } } foreach (var item in pListaVendorContact) { if (item.TipoOper == Convert.ToInt32(Operacion.Nuevo)) //Nuevo { item.IdVendor = pItem.IdVendor; VendorContact.Inserta(item); } else { VendorContact.Actualiza(item); } } foreach (var item in pListaVendorClassification) { if (item.TipoOper == Convert.ToInt32(Operacion.Nuevo)) //Nuevo { item.IdVendor = pItem.IdVendor; VendorClassification.Inserta(item); } else { VendorClassification.Actualiza(item); } } Vendor.Actualiza(pItem); ts.Complete(); } } catch (Exception ex) { throw ex; } }
public void Actualiza(VendorContactBE pItem) { try { VendorContactDL VendorContact = new VendorContactDL(); VendorContact.Actualiza(pItem); } catch (Exception ex) { throw ex; } }