Пример #1
0
        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; }
        }