예제 #1
0
 private void ValidateNombreCategoriaForm()
 {
     IsGuardarEnable = NombreCategoria.Validate();
     ((Command)CrearCategoriaCommand).ChangeCanExecute();
 }
예제 #2
0
        private void GenerarEstadisticos(int valor, string Deporte, string Fecha)
        {
            int contador = 1, contador1 = 1;
            List <NombreCategoria> nombre  = new List <NombreCategoria>();

            foreach (var item in manejadorRegistro.Lista)
            {
                if (item.categoriaRegistro == CmbEstadisticosCategoria.Text)
                {
                    NombreCategoria a = new NombreCategoria();
                    a.Cantidad = contador1++;
                    a.Nombre   = item.Nombre;
                    nombre.Add(a);
                }
            }

            List <VentasLista> listatorneo = new List <VentasLista>();

            foreach (var item in nombre)
            {
                float valores1 = 0;
                foreach (var item2 in manejadorVentas.Lista)
                {
                    if (item2.Nombre_Empleado == cmbFechaEstadisticos.Text)
                    {
                        if (item.Nombre == item2.Nombre_Empleado)
                        {
                            valores1 = valores1 + item2.Total;
                        }
                    }
                }
                VentasLista a = new VentasLista();
                a.X        = contador++;
                a.Mueble   = item.Nombre;
                a.cantidad = valores1;
                listatorneo.Add(a);
            }


            int valores = 0;

            valores = listatorneo.Count;
            generadora.GeneradorDatos(listatorneo, 1, valores, 1);
            dtgTablaEstadisticos.ItemsSource = null;
            dtgTablaEstadisticos.ItemsSource = listatorneo;
            PlotModel  model = new PlotModel();
            LinearAxis ejeX  = new LinearAxis();

            ejeX.Minimum  = 1;
            ejeX.Maximum  = valores;
            ejeX.Position = AxisPosition.Bottom;

            LinearAxis ejeY = new LinearAxis();

            ejeY.Minimum  = generadora.Puntos.Min(p => p.Y);
            ejeY.Maximum  = generadora.Puntos.Max(p => p.Y);
            ejeY.Position = AxisPosition.Left;

            model.Axes.Add(ejeX);
            model.Axes.Add(ejeY);
            model.Title = "Datos generados";
            LineSeries linea = new LineSeries();

            foreach (var item in generadora.Puntos)
            {
                linea.Points.Add(new DataPoint(item.X, item.Y));
            }
            linea.Title = "Valores generados";
            linea.Color = OxyColor.FromRgb(byte.Parse(ran.Next(0, 255).ToString()), byte.Parse(ran.Next(0, 255).ToString()), byte.Parse(ran.Next(0, 255).ToString()));
            model.Series.Add(linea);
            Grafica.Model = model;
        }
예제 #3
0
        /// <summary>
        /// LlenarCategorias: agrega los ítems a la vista
        /// </summary>
        public async Task LlenarCategorias()
        {
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 1,
                Nombre      = "Moda y belleza",
                Imagen      = "moda.png",
                Descripcion = "Moda y belleza"
            });
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 2,
                Nombre      = "Cuentos infantiles",
                Imagen      = "cuentos.png",
                Descripcion = "Cuentos infantiles"
            });
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 3,
                Nombre      = "Tecnología",
                Imagen      = "tecnologia.png",
                Descripcion = "Tecnología"
            });
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 4,
                Nombre      = "Naturaleza",
                Imagen      = "naturaleza.png",
                Descripcion = "Naturaleza"
            });
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 5,
                Nombre      = "Arte",
                Imagen      = "arte.png",
                Descripcion = "Arte"
            });

            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 6,
                Nombre      = "Baile",
                Imagen      = "baile.png",
                Descripcion = "Baile"
            });
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 7,
                Nombre      = "Negocios",
                Imagen      = "negocios.png",
                Descripcion = "Negocios"
            });
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 8,
                Nombre      = "Ciencia Ficción",
                Imagen      = "ciencia_ficcion.png",
                Descripcion = "Ciencia Ficción"
            });
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 9,
                Nombre      = "Juegos",
                Imagen      = "juegos.png",
                Descripcion = "Juegos"
            });
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 10,
                Nombre      = "Cine",
                Imagen      = "cine.png",
                Descripcion = "Cine"
            });
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 11,
                Nombre      = "Deporte",
                Imagen      = "deporte.png",
                Descripcion = "Deporte"
            });
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 12,
                Nombre      = "Idiomas",
                Imagen      = "idiomas.png",
                Descripcion = "Idiomas"
            });
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 13,
                Nombre      = "Mascotas",
                Imagen      = "mascota.png",
                Descripcion = "Mascotas"
            });
            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 14,
                Nombre      = "Música",
                Imagen      = "musica.png",
                Descripcion = "Música"
            });

            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 15,
                Nombre      = "Salud",
                Imagen      = "salud.png",
                Descripcion = "Salud"
            });

            NombreCategoria.Add(new CategoriaModel()
            {
                Id          = 16,
                Nombre      = "Matemáticas",
                Imagen      = "matematicas.png",
                Descripcion = "Matemáticas"
            });
        }