コード例 #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; }
        }
コード例 #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; }
        }
コード例 #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; }
        }
コード例 #4
0
 public void Elimina(ExtintorDetalleBE pItem)
 {
     try
     {
         ExtintorDetalleDL ExtintorDetalle = new ExtintorDetalleDL();
         ExtintorDetalle.Elimina(pItem);
     }
     catch (Exception ex)
     { throw ex; }
 }
コード例 #5
0
 public void Actualiza(ExtintorDetalleBE pItem)
 {
     try
     {
         ExtintorDetalleDL ExtintorDetalle = new ExtintorDetalleDL();
         ExtintorDetalle.Actualiza(pItem);
     }
     catch (Exception ex)
     { throw ex; }
 }
コード例 #6
0
 public List <ExtintorDetalleBE> ListaTodosActivo(int IdExtintor)
 {
     try
     {
         ExtintorDetalleDL ExtintorDetalle = new ExtintorDetalleDL();
         return(ExtintorDetalle.ListaTodosActivo(IdExtintor));
     }
     catch (Exception ex)
     { throw ex; }
 }
コード例 #7
0
 public ExtintorDetalleBE Selecciona(int IdExtintorDetalle)
 {
     try
     {
         ExtintorDetalleDL ExtintorDetalle = new ExtintorDetalleDL();
         ExtintorDetalleBE objEmp          = ExtintorDetalle.Selecciona(IdExtintorDetalle);
         return(objEmp);
     }
     catch (Exception ex)
     { throw ex; }
 }
コード例 #8
0
        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;
            }
        }