Beispiel #1
0
        public bool BuscarDetalleBoleta(int idDetalle)
        {
            try
            {
                Modelo.DETALLE_BOLETA detalleBoleta = ConectorDALC.ModeloAlmacen.DETALLE_BOLETA.FirstOrDefault(e => e.IDDETALLEB == idDetalle);
                if (detalleBoleta != null)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);

                throw new ArgumentException("Error al buscar" + ex);
            }
        }
Beispiel #2
0
        public bool AgregarDetalleBoleta()
        {
            try
            {
                Modelo.DETALLE_BOLETA detalleBoleta = new Modelo.DETALLE_BOLETA();

                detalleBoleta.BOLETA_NUMEROBOLETA = NumeroBoleta;
                detalleBoleta.PRODUCTO_CODIGO     = CodigoProducto;
                detalleBoleta.CANTIDAD            = Cantidad;

                ConectorDALC.ModeloAlmacen.DETALLE_BOLETA.Add(detalleBoleta);
                ConectorDALC.ModeloAlmacen.SaveChanges();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw new ArgumentException("Error al agregar detalle de boleta: " + ex);
            }
        }
Beispiel #3
0
        public bool EliminarDetalleBoleta(int idDetalle)
        {
            try
            {
                if (BuscarDetalleBoleta(idDetalle))
                {
                    Modelo.DETALLE_BOLETA detalleBoleta = ConectorDALC.ModeloAlmacen.DETALLE_BOLETA.FirstOrDefault(e => e.IDDETALLEB == idDetalle);
                    ConectorDALC.ModeloAlmacen.DETALLE_BOLETA.Remove(detalleBoleta);
                    ConectorDALC.ModeloAlmacen.SaveChanges();

                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);

                throw new ArgumentException("Error al eliminar detalle de boleta: " + ex);
            }
        }