private void Update()
        {
            ReadBC objReader = new ReadBC();
            EntradaArticulos = objReader.ReadEntradaArticulo(factura.IdFactura);
            this.DataContext = EntradaArticulos;

            ReadBC objReaderPendiente = new ReadBC();
            PendienteArticulos = objReaderPendiente.ReadPendienteArticulo(factura.IdFactura);
            listPendienteArticulo.DataContext = PendienteArticulos;
            
            double total = 0;

            foreach (EntradaArticulo art in EntradaArticulos) 
            {
                total += art.Precio * art.Cantidad;
            }
            txtTotal.Text = total.ToString("$ 0.00");

        }
        private void btnEliminarEntrada_Click(object sender, RoutedEventArgs e)
        {
            EntradaArticulo reg = listEntradaArticulo.SelectedValue as EntradaArticulo;
            DeleteBC objDelete = new DeleteBC();
            objDelete.DeleteEntrada(reg.IdEntrada);

            ReadBC objReader = new ReadBC();
            EntradaArticulos = objReader.ReadEntradaArticulo(factura.IdFactura);
            this.DataContext = EntradaArticulos;
        }
        private void btnAgregarEntrada_Click(object sender, RoutedEventArgs e)
        {
            Pages.AgregarEntrada dialog = new Pages.AgregarEntrada();

            dialog.Title = "Agregar";
            dialog.Content = new Pages.AgregarArticulo();
            dialog.ResizeMode = ResizeMode.CanResize;
            dialog.UpdateLayout();
            dialog.ShowDialog();

            

            if (agregar) 
            {
                Entrada nuevaEntrada = new Entrada();
                nuevaEntrada = ArticuloNuevo;
                CreateBC objCreate = new CreateBC();
                objCreate.Create(nuevaEntrada);

                ReadBC objReader = new ReadBC();
                EntradaArticulos = objReader.ReadEntradaArticulo();
                this.DataContext = EntradaArticulos;
                agregar = false;
            }
            else 
            {
            
            }
            
        }