Exemplo n.º 1
0
        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; }
        }
Exemplo n.º 2
0
        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; }
        }
Exemplo n.º 3
0
        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; }
        }
Exemplo n.º 4
0
 public List <ExtintorBE> ListaInspeccionDetalle(int IdEmpresa, int IdUnidadMinera)
 {
     try
     {
         ExtintorDL Extintor = new ExtintorDL();
         return(Extintor.ListaInspeccionDetalle(IdEmpresa, IdUnidadMinera));
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemplo n.º 5
0
 public List <ExtintorBE> ListaTipoServicio(int IdEmpresa, int IdUnidadMinera)
 {
     try
     {
         ExtintorDL Extintor = new ExtintorDL();
         return(Extintor.ListaTipoServicio(IdEmpresa, IdUnidadMinera));
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemplo n.º 6
0
 public List <ExtintorBE> ListaPorVencer(int IdEmpresa, int IdUnidadMinera, int Dias)
 {
     try
     {
         ExtintorDL Extintor = new ExtintorDL();
         return(Extintor.ListaPorVencer(IdEmpresa, IdUnidadMinera, Dias));
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemplo n.º 7
0
 public List <ExtintorBE> ListaCodigo(string Codigo)
 {
     try
     {
         ExtintorDL Extintor = new ExtintorDL();
         return(Extintor.ListaCodigo(Codigo));
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemplo n.º 8
0
 public List <ExtintorBE> ListaFecha(int IdEmpresa, int IdUnidadMinera, DateTime FechaDesde, DateTime FechaHasta)
 {
     try
     {
         ExtintorDL Extintor = new ExtintorDL();
         return(Extintor.ListaFecha(IdEmpresa, IdUnidadMinera, FechaDesde, FechaHasta));
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemplo n.º 9
0
 public ExtintorBE SeleccionaCodigo(string Codigo)
 {
     try
     {
         ExtintorDL Extintor = new ExtintorDL();
         ExtintorBE objEmp   = Extintor.SeleccionaCodigo(Codigo);
         return(objEmp);
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemplo n.º 10
0
 public ExtintorBE Selecciona(int IdExtintor)
 {
     try
     {
         ExtintorDL Extintor = new ExtintorDL();
         ExtintorBE objEmp   = Extintor.Selecciona(IdExtintor);
         return(objEmp);
     }
     catch (Exception ex)
     { throw ex; }
 }