Beispiel #1
0
        private void BusquedaTextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            string busqueda = BusquedaTextBox.Text;

            if (busqueda != string.Empty)
            {
                AlimentosVisibles = AlimentosCargados.FindAll(alimento => alimento.Nombre.ToLower().Contains(busqueda.ToLower())).ToList();
            }
            else
            {
                AlimentosVisibles = AlimentosCargados;
            }
            ActualizarPantalla();
        }
Beispiel #2
0
        public GUIEditarPedido(ControladorDeCambioDePantalla controlador, Empleado empleadoDeCallCenter, Pedido pedido)
        {
            InitializeComponent();
            this.EmpleadoDeCallCenter = empleadoDeCallCenter;
            this.Pedido = pedido;
            IvaDAO      ivaDAO      = new IvaDAO();
            PlatilloDAO platilloDAO = new PlatilloDAO();
            ProductoDAO productoDAO = new ProductoDAO();

            try
            {
                Iva = ivaDAO.CargarIvaActual();
            }
            catch (InvalidOperationException e)
            {
                MessageBox.Show(e.Message + "Porfavor contacte a su administrador", "Error! ", MessageBoxButton.OK);
                controlador.Regresar();
            }

            IvaLabel.Content          = "IVA(" + Iva.Valor * 10 + "%)";
            Controlador               = controlador;
            BarraDeEstado.Controlador = controlador;
            try
            {
                ProductosCargados = productoDAO.CargarProductosActivos();
                PlatillosCargados = platilloDAO.CargarTodos();
            }
            catch (InvalidOperationException e)
            {
                MessageBox.Show(e.Message + "Porfavor contacte a su administrador", "Error! ", MessageBoxButton.OK);
                controlador.Regresar();
            }
            AlimentosCargados = AlimentosCargados.Concat(PlatillosCargados).ToList();
            AlimentosCargados = AlimentosCargados.Concat(ProductosCargados).ToList();
            AlimentosVisibles = AlimentosCargados;
            ActualizarPantalla();
            BarraDeEstado.ActualizarEmpleado(empleadoDeCallCenter);
        }