Esempio n. 1
0
    public IColeccion Duplicar()
    {
        IColeccion copia = new Coleccion();

        copia.Set(0, this.Get(0));
        return(copia);
    }
Esempio n. 2
0
        static void Main(string[] args)
        {
            System.Collections.Generic.Stack <Punto> puntosStack =
                new System.Collections.Generic.Stack <Punto>();

            // Stack
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("Stack");
            Console.ForegroundColor = ConsoleColor.DarkGray;

            // Añadiendo nuevos datos
            puntosStack.Push(new Punto(3, 4));
            puntosStack.Push(new Punto(5, 7));
            puntosStack.Push(new Punto(9, 6));
            puntosStack.Push(new Punto(1, 4));
            Coleccion coleccion = new Coleccion();

            coleccion.Show(puntosStack);

            // Hacemos un peek
            Console.Write("Peek {0}\n", puntosStack.Peek());

            coleccion.Show(puntosStack);

            // Hacemos dos pop
            Console.Write("Pop {0}\n", puntosStack.Pop());
            Console.Write("Pop {0}\n", puntosStack.Pop());

            coleccion.Show(puntosStack);

            // Queue
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("Queue");
            Console.ForegroundColor = ConsoleColor.White;

            System.Collections.Generic.Queue <Punto> puntosQueue =
                new System.Collections.Generic.Queue <Punto>();

            // Añadiendo nuevos datos
            puntosQueue.Enqueue(new Punto(5, 4));
            puntosQueue.Enqueue(new Punto(4, 7));
            puntosQueue.Enqueue(new Punto(1, 6));
            puntosQueue.Enqueue(new Punto(7, 4));

            coleccion.Show(puntosQueue);

            // Hacemos un Peek
            Console.Write("Peek {0}\n", puntosQueue.Peek());

            // Hacemos dequeue
            Console.Write("Dequeue {0}\n", puntosQueue.Dequeue());
            Console.Write("Dequeue {0}\n", puntosQueue.Dequeue());
            Console.Write("Dequeue {0}\n", puntosQueue.Dequeue());
            coleccion.Show(puntosQueue);
            Console.Write("Dequeue {0}\n", puntosQueue.Dequeue());
            coleccion.Show(puntosQueue);
            Console.ReadKey();
        }
Esempio n. 3
0
        private void CargarRubroProveedor()
        {
            Coleccion col = new Coleccion();

            ddlRubro.DataSource =
                (from rubro in col.ObtenerRubroProveedor()
                 select rubro.RUBRO).Distinct();
            ddlRubro.DataBind();
        }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     mMovimiento = GetComponent <Movimiento>();
     laUtilidad  = GetComponentInChildren <Slider>();
     laColeccion = GetComponent <Coleccion>();
     Sangre      = GameObject.FindGameObjectWithTag("Sangre");
     Palpitacion = GameObject.FindGameObjectWithTag("Palpitacion");
     renderPlano = GetComponentInChildren <Renderer>();
     mTransform  = GetComponent <Transform>();
 }
Esempio n. 5
0
        public void CrearColeccionSatisfactoriamente()
        {
            var loColeccion   = Coleccion.Registrar("20180001", "2018001", "Facultad de Ingenieria", "Escuela Profesional de Ingenieria de Sistemas", "Ingeniera de Sistemas", "1");
            var loRepositorio = new  RepositoriosDatos();

            loRepositorio.Adicionar <Coleccion>(loColeccion);
            loRepositorio.GuardarCambios();
            Assert.IsNotNull(loColeccion);
            Assert.IsTrue(loColeccion.IdColeccion == "20180001");
        }
Esempio n. 6
0
        private async void CargarColecciones()
        {
            Coleccion col = new Coleccion();
            Task <List <Coleccion> > t = Task <List <Coleccion> > .Factory.StartNew(() => col.fetchAll());

            await t;

            listColecciones.ItemsSource       = t.Result;
            listColecciones.DisplayMemberPath = "nombre";
        }
Esempio n. 7
0
        private async void CargarClasificaciones(Categoria cat, Coleccion col)
        {
            Task <List <Clasificacion> > t = Task <List <Clasificacion> > .Factory.StartNew(() => cat.regresarClasificacion(col.id.ToString()));

            await t;

            clasPanel.Visibility       = Visibility.Visible;
            listClas.ItemsSource       = t.Result;
            listClas.DisplayMemberPath = "nombre";
        }
Esempio n. 8
0
        private async void CargarCategorias(Coleccion col)
        {
            Task <List <Categoria> > t = Task <List <Categoria> > .Factory.StartNew(() => col.ObtenerCategorias());

            await t;

            catsPanel.Visibility       = Visibility.Visible;
            listCats.ItemsSource       = t.Result;
            listCats.DisplayMemberPath = "nombre";
            clasPanel.Visibility       = Visibility.Collapsed;
            addButton.Visibility       = Visibility.Hidden;
        }
Esempio n. 9
0
        private void listColecciones_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBox   list = sender as ListBox;
            Coleccion col  = list.SelectedItem as Coleccion;

            if (list != null)
            {
                if (list.SelectedItem != null)
                {
                    CargarCategorias(col);
                    CargarPiezas("?coleccion=" + col.id);
                }
            }
        }
Esempio n. 10
0
        private void CargarCiudadProveedor()
        {
            Coleccion col = new Coleccion();

            ddlCiudad.Items.Clear();
            foreach (Ciudad c in col.ObtenerCiudad())
            {
                ddlCiudad.Items.Add(new ListItem()
                {
                    Text  = c.DESCRIPCION,
                    Value = c.ID_CIUDAD.ToString()
                });
            }
            ddlCiudad.DataBind();
        }
Esempio n. 11
0
        private void listCats_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBox   list = sender as ListBox;
            Coleccion col  = listColecciones.SelectedItem as Coleccion;
            Categoria cat  = list.SelectedItem as Categoria;

            if (list != null)
            {
                if (cat != null && col != null)
                {
                    CargarClasificaciones(cat, col);
                    CargarPiezas("?coleccion=" + col.id + "&categoria=" + cat.id);
                }
            }
        }
Esempio n. 12
0
        public FormReporte()
        {
            InitializeComponent();
            this.SuspendLayout();

            comboArea.DataSource    = new BindingSource(Coleccion.GetInstance().Area, null);
            comboArea.DisplayMember = "Value";
            comboArea.ValueMember   = "Key";

            comboMes.DataSource    = new BindingSource(Coleccion.GetInstance().Mes, null);
            comboMes.DisplayMember = "Value";
            comboMes.ValueMember   = "Key";
            this.ResumeLayout(false);
            InicializarTabla();
        }
Esempio n. 13
0
 private void btnEliminarColeccion_Click(object sender, RoutedEventArgs e)
 {
     if (gvColecciones.SelectedValue != null)
     {
         Coleccion coleccion = new Coleccion();
         coleccion = (Coleccion)gvColecciones.SelectedItem;
         coleccion.eliminar();
         if (Connection.Objects.Error.isActivo())
         {
             MessageBox.Show(Connection.Objects.Error.descripcionError, Connection.Objects.Error.nombreError);
         }
         else
         {
             MessageBox.Show("Se ha eliminado correctamente", "Correcto");
             actualizarTablas();
         }
     }
     else
     {
         MessageBox.Show("Debe seleccionar una colección antes de eliminar", "Advertencia");
     }
 }
Esempio n. 14
0
        static void Main(string[] args)
        {
            // Colecciones adentro de System.Collection
            // ArrayList
            // BitArray
            // Hashtable (k,v)
            // Queue
            // SortedList (k,v) k,v
            // Stack
            int       r    = 0;
            Coleccion show = new Coleccion();

            #region https://youtu.be/GAal3fPN59g
            System.Collections.ArrayList Palabras =
                new System.Collections.ArrayList();

            // Podemos adiccionar con rango
            Palabras.AddRange(new System.String[] {
                "Hola", "como", "estas?"
            });

            CountElement.Count(Palabras);

            // Recorremos el Array con loop for
            show.Show(Palabras, 2);

            // Agragar mas palabra
            Palabras.Add("Bien y tu?");
            // Volvemos a mostrar el total de elementos
            CountElement.Count(Palabras);

            //Recorriendo con foreach
            show.ShowForeach(Palabras, 2);

            #endregion

            #region https://youtu.be/bdGSQ-9N22s
            // Array con valores numericos
            System.Collections.ArrayList Valores =
                new System.Collections.ArrayList();

            Valores.AddRange(new int[] { 5, 6 });
            Valores.Add(7);
            Valores.Add(8);

            ////
            CountElement.Count(Valores);
            ////

            // Recorremos con loop for
            show.Show(Valores, 1, r);


            // Verificar si existe un elemento en el ArrayList
            //con el metodo Contains()
            System.Console.WriteLine(" 5 existe " + Valores.Contains(5));
            System.Console.WriteLine(" 1 existe {0}", Valores.Contains(1));
            System.Console.Write("--------\n");

            // Insertamos en un indice en particular
            Valores.Insert(2, 4);

            ////
            CountElement.Count(Valores);
            ////

            show.ShowForeach(Valores, 2);

            // Remover un elemento
            Valores.Remove(4);
            CountElement.Count(Valores);
            show.Show(Valores, 1, r);

            // Remover en una posicion
            Valores.RemoveAt(0);
            CountElement.Count(Valores);
            show.Show(Valores, 1, r);
            #endregion
            System.Console.ReadKey();
        }
Esempio n. 15
0
 static void Main(string[] args)
 {
     Console.WriteLine("Hello World!");
     Coleccion  c1 = new Coleccion();
     IColeccion c2 = Program.Reversa(c1);
 }
Esempio n. 16
0
        static void Main(string[] args)
        {
            #region https://youtu.be/_UtKEYYhi24
            Coleccion show = new Coleccion();
            System.Collections.BitArray bitArray =
                new System.Collections.BitArray(
                    new byte[] { 1, 2, 4, 8, 16 });// Convertiendo byte a bit

            CountElement.Count(bitArray);
            Coleccion.Show(bitArray, 2);

            //// Obtenemos un bit en particular
            System.Console.WriteLine(bitArray.Get(3));

            //// ponemos un bit en particular
            bitArray.Set(3, true);
            System.Console.WriteLine(bitArray.Get(3));
            Coleccion.Show(bitArray, 2);


            //https://youtu.be/pGS78ttnqfY

            // Clonacion del BitArray
            System.Collections.BitArray bitArray2 =
                (System.Collections.BitArray)bitArray.Clone();

            //// Invertir el Array, NOT
            bitArray2.Not();
            Coleccion.Show(bitArray2, 2);

            // Creando otro Array
            System.Collections.BitArray bitArray3 =
                new System.Collections.BitArray(new byte[] { 5, 7, 9, 13, 15 });
            Coleccion.Show(bitArray3, 2, "3°Array");

            //// Hacemos Or entre Arreglos
            bitArray3.Or(bitArray); // El resultado se guarda en el Array que llevo
                                    //acabo la invocacion.
            Coleccion.Show(bitArray, pNombre: "1°Array");
            Coleccion.Show(bitArray3, 3, pNombre: "Result");
            System.Console.WriteLine("=|||||||||=");

            //// Hacemos AND entre Array
            Coleccion.Show(bitArray, pNombre: "1°Array");
            Coleccion.Show(bitArray3, pNombre: "3°Array");

            // Hacemos el AND, BitArray 3 se modifica con el resultado
            bitArray3.And(bitArray);
            Coleccion.Show(bitArray3, 3, "Result");
            System.Console.WriteLine("=&&&&&&&&&&&=");

            //// Hamos XOR entre Array
            bitArray3 =
                new System.Collections.BitArray(new byte[] { 5, 7, 9, 13, 21 });
            Coleccion.Show(bitArray, pNombre: "1°Array");
            Coleccion.Show(bitArray3, pNombre: "3°Array");

            // Hacemos el XOR, Array 3 se modifica con el resultado
            bitArray3.Xor(bitArray);
            Coleccion.Show(bitArray3, pNombre: "Result");

            System.Console.ReadKey();
            #endregion
        }
Esempio n. 17
0
 public List <Document> GetAll()
 {
     return(Coleccion.FindAllAs <Document>().ToList <Document>());
 }