示例#1
0
        public void Elimina(SolicitudEppBE pItem)
        {
            try
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    SolicitudEppDL        SolicitudEpp        = new SolicitudEppDL();
                    SolicitudEppDetalleDL SolicitudEppDetalle = new SolicitudEppDetalleDL();

                    List <SolicitudEppDetalleBE> lstSolicitudEppDetalle = null;
                    lstSolicitudEppDetalle = new SolicitudEppDetalleDL().ListaTodosActivo(pItem.IdSolicitudEpp);

                    foreach (SolicitudEppDetalleBE item in lstSolicitudEppDetalle)
                    {
                        SolicitudEppDetalle.Elimina(item);
                    }

                    SolicitudEpp.Elimina(pItem);

                    ts.Complete();
                }
            }
            catch (Exception ex)
            { throw ex; }
        }
示例#2
0
        public void Actualiza(SolicitudEppBE pItem, List <SolicitudEppDetalleBE> pListaSolicitudEppDetalle)
        {
            try
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    SolicitudEppDL        SolicitudEpp        = new SolicitudEppDL();
                    SolicitudEppDetalleDL SolicitudEppDetalle = new SolicitudEppDetalleDL();

                    foreach (SolicitudEppDetalleBE item in pListaSolicitudEppDetalle)
                    {
                        if (item.TipoOper == Convert.ToInt32(Operacion.Nuevo)) //Nuevo
                        {
                            item.IdSolicitudEpp = pItem.IdSolicitudEpp;
                            SolicitudEppDetalle.Inserta(item);
                        }
                        else
                        {
                            SolicitudEppDetalle.Actualiza(item);
                        }
                    }

                    SolicitudEpp.Actualiza(pItem);

                    ts.Complete();
                }
            }
            catch (Exception ex)
            { throw ex; }
        }
示例#3
0
        public Int32 Inserta(SolicitudEppBE pItem, List <SolicitudEppDetalleBE> pListaSolicitudEppDetalle)
        {
            try
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    SolicitudEppDL        SolicitudEpp        = new SolicitudEppDL();
                    SolicitudEppDetalleDL SolicitudEppDetalle = new SolicitudEppDetalleDL();

                    int IdSolicitudEpp = 0;
                    IdSolicitudEpp = SolicitudEpp.Inserta(pItem);

                    foreach (var item in pListaSolicitudEppDetalle)
                    {
                        item.IdSolicitudEpp = IdSolicitudEpp;
                        SolicitudEppDetalle.Inserta(item);
                    }

                    ts.Complete();

                    return(IdSolicitudEpp);
                }
            }
            catch (Exception ex)
            { throw ex; }
        }
示例#4
0
 public void Elimina(SolicitudEppDetalleBE pItem)
 {
     try
     {
         SolicitudEppDetalleDL SolicitudEppDetalle = new SolicitudEppDetalleDL();
         SolicitudEppDetalle.Elimina(pItem);
     }
     catch (Exception ex)
     { throw ex; }
 }
示例#5
0
 public List <SolicitudEppDetalleBE> ListaTodosActivo(int IdEpp)
 {
     try
     {
         SolicitudEppDetalleDL SolicitudEppDetalle = new SolicitudEppDetalleDL();
         return(SolicitudEppDetalle.ListaTodosActivo(IdEpp));
     }
     catch (Exception ex)
     { throw ex; }
 }
示例#6
0
 public SolicitudEppDetalleBE Selecciona(int IdSolicitudEppDetalle)
 {
     try
     {
         SolicitudEppDetalleDL SolicitudEppDetalle = new SolicitudEppDetalleDL();
         SolicitudEppDetalleBE objEmp = SolicitudEppDetalle.Selecciona(IdSolicitudEppDetalle);
         return(objEmp);
     }
     catch (Exception ex)
     { throw ex; }
 }