Exemplo n.º 1
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.º 2
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.º 3
0
 public void Inserta(ExtintorDetalleBE pItem)
 {
     try
     {
         ExtintorDetalleDL ExtintorDetalle = new ExtintorDetalleDL();
         ExtintorDetalle.Inserta(pItem);
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemplo n.º 4
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;
            }
        }