示例#1
0
        public void ProbarCargarIngredientesActivos_BaseDeDatosActiva_RegresaListaDeIngredientes()
        {
            IngredienteDAO ingredienteDAO = new IngredienteDAO();
            List <LogicaDeNegocio.Clases.Ingrediente> ingredientes = ingredienteDAO.CargarIngredientesActivos();

            Assert.AreEqual(2, ingredientes.Count);
        }
        public GUIRegistrarIngrediente(ControladorDeCambioDePantalla controlador, Empleado empleado)
        {
            Controlador = controlador;
            Empleado    = empleado;
            InitializeComponent();
            IngredienteDAO ingredienteDAO = new IngredienteDAO();

            try
            {
                Ingredientes = ingredienteDAO.CargarIngredientesActivos();
            }
            catch (InvalidOperationException ex)
            {
                MessageBox.Show(ex.Message + "Porfavor contacte a su administrador", "Error! ", MessageBoxButton.OK);
                controlador.Regresar();
            }

            DataGridIngredientes.ItemsSource = Ingredientes;

            BarraDeEstado.Controlador = controlador;
            BarraDeEstado.ActualizarEmpleado(empleado);
            GridCompuestos.Visibility          = Visibility.Collapsed;
            ComboBoxUnidadMedida.ItemsSource   = Enum.GetValues(typeof(UnidadDeMedida));
            ComboBoxUnidadMedida.SelectedIndex = 0;
        }
示例#3
0
        public void CargarIngredientesActivos_Exitoso_RegresaListaIngredientes()
        {
            IngredienteDAO     ingredienteDAO = new IngredienteDAO();
            List <Ingrediente> ingredientes   = ingredienteDAO.CargarIngredientesActivos();

            int INGREDIENTES_EN_BASEDEDATOS = 7;

            Assert.AreEqual(INGREDIENTES_EN_BASEDEDATOS, ingredientes.Count);
        }
示例#4
0
        public GUIRegistrarPlatillo(ControladorDeCambioDePantalla controlador, Empleado empleadoCargado)
        {
            InitializeComponent();
            Controlador = controlador;
            BarraDeEstado.Controlador = controlador;
            Gerente = empleadoCargado;
            BarraDeEstado.ActualizarEmpleado(Gerente);
            IngredienteDAO ingredienteDAO = new IngredienteDAO();

            IngredientesCargados         = ingredienteDAO.CargarIngredientesActivos();
            IngredientesVisibles         = IngredientesCargados;
            BusquedaDataGrid.ItemsSource = IngredientesVisibles;
            ActualizarGanancia();
        }
示例#5
0
        public GUIPasarInventario(ControladorDeCambioDePantalla controlador, Empleado empleadoCargado)
        {
            InitializeComponent();
            Gerente     = empleadoCargado;
            Controlador = controlador;
            BarraDeEstado.Controlador = controlador;
            IngredienteDAO ingredienteDAO = new IngredienteDAO();
            ProductoDAO    productoDAO    = new ProductoDAO();

            ProductosCargados            = productoDAO.CargarProductosActivos();
            IngredientesCargados         = ingredienteDAO.CargarIngredientesActivos();
            ObjetosDeInventarioCargados  = CombinarIngredientesYProductos(IngredientesCargados, ProductosCargados);
            ObjetosDeInventarioVisibles  = ObjetosDeInventarioCargados;
            BusquedaDataGrid.ItemsSource = ObjetosDeInventarioVisibles;
        }
        public GUIEditarPlatillo(ControladorDeCambioDePantalla controlador, Empleado empleadoCargado, Platillo platillo)
        {
            InitializeComponent();
            Controlador = controlador;
            BarraDeEstado.Controlador = controlador;
            Gerente  = empleadoCargado;
            Platillo = platillo;
            ProporcionesOriginales = new List <Proporcion>();
            foreach (Proporcion proporcion in Platillo.Proporciones)
            {
                ProporcionesOriginales.Add(proporcion);
            }
            BarraDeEstado.ActualizarEmpleado(Gerente);
            IngredienteDAO ingredienteDAO = new IngredienteDAO();

            IngredientesCargados         = ingredienteDAO.CargarIngredientesActivos();
            IngredientesVisibles         = IngredientesCargados;
            BusquedaDataGrid.ItemsSource = IngredientesVisibles;
            AsignarPlatilloAInterfaz(Platillo);
        }