public void Elimina(ClientDocumentBE pItem) { try { ClientDocumentDL ClientDocument = new ClientDocumentDL(); ClientDocument.Elimina(pItem); } catch (Exception ex) { throw ex; } }
public void Elimina(ClientBE pItem) { try { using (TransactionScope ts = new TransactionScope()) { ClientDL Client = new ClientDL(); ClientAddressDL ClientAddress = new ClientAddressDL(); ClientContactDL ClientContact = new ClientContactDL(); ClientDepartmentDL ClientDepartment = new ClientDepartmentDL(); ClientDocumentDL ClientDocument = new ClientDocumentDL(); ClientGoalDL ClientGoal = new ClientGoalDL(); ClientBrandDL ClientBrand = new ClientBrandDL(); //Client SENSOR List <ClientAddressBE> lstClientAddress = null; lstClientAddress = new ClientAddressDL().ListaTodosActivo(pItem.IdClient); foreach (var item in lstClientAddress) { ClientAddress.Elimina(item); } //Client VERIFICACIÓN List <ClientContactBE> lstClientContact = null; lstClientContact = new ClientContactDL().ListaTodosActivo(pItem.IdClient); foreach (var item in lstClientContact) { ClientContact.Elimina(item); } //Client MOVIMIENTO List <ClientDepartmentBE> lstClientDepartment = null; lstClientDepartment = new ClientDepartmentDL().ListaTodosActivo(pItem.IdClient); foreach (var item in lstClientDepartment) { ClientDepartment.Elimina(item); } //Client DIAGNOSTICO List <ClientDocumentBE> lstClientDocument = null; lstClientDocument = new ClientDocumentDL().ListaTodosActivo(pItem.IdClient); foreach (var item in lstClientDocument) { ClientDocument.Elimina(item); } //CLIENT GOAL List <ClientGoalBE> lstClientGoal = null; lstClientGoal = new ClientGoalDL().ListaTodosActivo(pItem.IdClient); foreach (var item in lstClientGoal) { ClientGoal.Elimina(item); } //Client BRAND List <ClientBrandBE> lstClientBrand = null; lstClientBrand = new ClientBrandDL().ListaTodosActivo(pItem.IdClient); foreach (var item in lstClientBrand) { ClientBrand.Elimina(item); } Client.Elimina(pItem); ts.Complete(); } } catch (Exception ex) { throw ex; } }