public void Actualiza(TemaBE pItem, List <TemaDetalleBE> pListaTemaDetalle) { try { using (TransactionScope ts = new TransactionScope()) { TemaDL Tema = new TemaDL(); TemaDetalleDL TemaDetalle = new TemaDetalleDL(); foreach (TemaDetalleBE item in pListaTemaDetalle) { if (item.TipoOper == Convert.ToInt32(Operacion.Nuevo)) //Nuevo { item.IdTema = pItem.IdTema; TemaDetalle.Inserta(item); } else { TemaDetalle.Actualiza(item); } } Tema.Actualiza(pItem); ts.Complete(); } } catch (Exception ex) { throw ex; } }
public void Elimina(TemaBE pItem) { try { using (TransactionScope ts = new TransactionScope()) { TemaDL Tema = new TemaDL(); TemaDetalleDL TemaDetalle = new TemaDetalleDL(); List <TemaDetalleBE> lstTemaDetalle = null; lstTemaDetalle = new TemaDetalleDL().ListaTodosActivo(pItem.IdTema); foreach (TemaDetalleBE item in lstTemaDetalle) { TemaDetalle.Elimina(item); } Tema.Elimina(pItem); ts.Complete(); } } catch (Exception ex) { throw ex; } }
public void Elimina(TemaDetalleBE pItem) { try { TemaDetalleDL TemaDetalle = new TemaDetalleDL(); TemaDetalle.Elimina(pItem); } catch (Exception ex) { throw ex; } }
public void Actualiza(TemaDetalleBE pItem) { try { TemaDetalleDL TemaDetalle = new TemaDetalleDL(); TemaDetalle.Actualiza(pItem); } catch (Exception ex) { throw ex; } }
public List <TemaDetalleBE> ListaTodosActivo(int IdTema) { try { TemaDetalleDL TemaDetalle = new TemaDetalleDL(); return(TemaDetalle.ListaTodosActivo(IdTema)); } catch (Exception ex) { throw ex; } }
public TemaDetalleBE Selecciona(int IdTemaDetalle) { try { TemaDetalleDL TemaDetalle = new TemaDetalleDL(); TemaDetalleBE objEmp = TemaDetalle.Selecciona(IdTemaDetalle); return(objEmp); } catch (Exception ex) { throw ex; } }
public void Inserta(TemaBE pItem, List <TemaDetalleBE> pListaTemaDetalle) { try { using (TransactionScope ts = new TransactionScope()) { TemaDL Tema = new TemaDL(); TemaDetalleDL TemaDetalle = new TemaDetalleDL(); int intIdTema = 0; intIdTema = Tema.Inserta(pItem); foreach (var item in pListaTemaDetalle) { item.IdTema = intIdTema; TemaDetalle.Inserta(item); } ts.Complete(); } } catch (Exception ex) { throw ex; } }