public void Elimina(ExtintorBE pItem) { try { using (TransactionScope ts = new TransactionScope()) { ExtintorDL Extintor = new ExtintorDL(); ExtintorDetalleDL ExtintorDetalle = new ExtintorDetalleDL(); List <ExtintorDetalleBE> lstExtintorDetalle = null; lstExtintorDetalle = new ExtintorDetalleDL().ListaTodosActivo(pItem.IdExtintor); foreach (ExtintorDetalleBE item in lstExtintorDetalle) { ExtintorDetalle.Elimina(item); } Extintor.Elimina(pItem); ts.Complete(); } } catch (Exception ex) { throw ex; } }
public void Actualiza(ExtintorBE pItem, List <ExtintorDetalleBE> pListaExtintorDetalle) { try { using (TransactionScope ts = new TransactionScope()) { ExtintorDL Extintor = new ExtintorDL(); ExtintorDetalleDL ExtintorDetalle = new ExtintorDetalleDL(); foreach (ExtintorDetalleBE item in pListaExtintorDetalle) { if (item.TipoOper == Convert.ToInt32(Operacion.Nuevo)) //Nuevo { item.IdExtintor = pItem.IdExtintor; ExtintorDetalle.Inserta(item); } else { ExtintorDetalle.Actualiza(item); } } Extintor.Actualiza(pItem); ts.Complete(); } } catch (Exception ex) { throw ex; } }
public Int32 Inserta(ExtintorBE pItem, List <ExtintorDetalleBE> pListaExtintorDetalle) { try { using (TransactionScope ts = new TransactionScope()) { ExtintorDL Extintor = new ExtintorDL(); ExtintorDetalleDL ExtintorDetalle = new ExtintorDetalleDL(); int IdExtintor = 0; IdExtintor = Extintor.Inserta(pItem); foreach (var item in pListaExtintorDetalle) { item.IdExtintor = IdExtintor; ExtintorDetalle.Inserta(item); } ts.Complete(); return(IdExtintor); } } catch (Exception ex) { throw ex; } }
public void Elimina(ExtintorDetalleBE pItem) { try { ExtintorDetalleDL ExtintorDetalle = new ExtintorDetalleDL(); ExtintorDetalle.Elimina(pItem); } catch (Exception ex) { throw ex; } }
public void Actualiza(ExtintorDetalleBE pItem) { try { ExtintorDetalleDL ExtintorDetalle = new ExtintorDetalleDL(); ExtintorDetalle.Actualiza(pItem); } catch (Exception ex) { throw ex; } }
public List <ExtintorDetalleBE> ListaTodosActivo(int IdExtintor) { try { ExtintorDetalleDL ExtintorDetalle = new ExtintorDetalleDL(); return(ExtintorDetalle.ListaTodosActivo(IdExtintor)); } catch (Exception ex) { throw ex; } }
public ExtintorDetalleBE Selecciona(int IdExtintorDetalle) { try { ExtintorDetalleDL ExtintorDetalle = new ExtintorDetalleDL(); ExtintorDetalleBE objEmp = ExtintorDetalle.Selecciona(IdExtintorDetalle); return(objEmp); } catch (Exception ex) { throw ex; } }
public void InsertaMasivo(List <ExtintorDetalleBE> pListaExtintorDetalle) { try { using (TransactionScope ts = new TransactionScope()) { ExtintorDetalleDL objExtintorDetalle = new ExtintorDetalleDL(); foreach (ExtintorDetalleBE item in pListaExtintorDetalle) { objExtintorDetalle.Inserta(item); } ts.Complete(); } } catch (Exception ex) { throw ex; } }