Example #1
0
        private void buttonSearch_Click_1(object sender, EventArgs e)
        {
            if (textBoxSearch.Text != "")
            {
                bool           validationData;
                GestionArchivo gs = new GestionArchivo(pathDataBase);
                gs.PathTemp = PathTemp;

                int position = getPosition(Titles, SearchFor);

                validationData = gs.SearchData(textBoxSearch.Text, position);
                if (validationData)
                {
                    MessageInfoAlert.ForeColor = Color.Green;
                    MessageInfoAlert.Text      = "¡Busqueda exitosa!";
                    panel.Controls.Clear();
                    ImprimirData(panel, PathTemp, Titles).Show();
                }
                else
                {
                    MessageInfoAlert.ForeColor = Color.Red;
                    MessageInfoAlert.Text      = "¡No encontrado!";
                }
            }
            else
            {
                MessageInfoAlert.Text = "¡Campo vacio!";
            }
        }
Example #2
0
        private void buttonSearch_Click(object sender, EventArgs e)
        {
            if (textBoxSearch.Text != "")
            {
                string         validationData;
                GestionArchivo gs = new GestionArchivo(Cliente.path);
                gs.PathTemp = PathTemp;

                int position = getPosition(Titles, SearchFor);

                validationData = gs.SearchData(textBoxSearch.Text, position);
                if (validationData != null)
                {
                    data = validationData;
                    MessageInfoAlert.ForeColor = Color.Green;
                    MessageInfoAlert.Text      = "¡Busqueda exitosa!";
                }
                else
                {
                    data = null;
                    MessageInfoAlert.ForeColor = Color.Red;
                    MessageInfoAlert.Text      = "¡No encontrado!";
                }
            }
            else
            {
                MessageInfoAlert.Text = "¡Campo vacio!";
            }
        }
Example #3
0
 public void Delete()//Here
 {
     if (Find(this.CedulaVendedor))
     {
         ListaUsers.Remove(this);
         GestionArchivo gs = new GestionArchivo(path);
         gs.Save(CedulaVendedor.ToString());
     }
 }
Example #4
0
 public void Delete()
 {
     if (Find(this.IdFactura))
     {
         ListaFactura.Remove(this);
         GestionArchivo gs = new GestionArchivo(pathID);
         gs.Save(IdFactura.ToString());
     }
 }
Example #5
0
 public void Delete()
 {
     if (Find(this.IdVendedor))
     {
         ListaVendedores.Remove(this);
         GestionArchivo gs = new GestionArchivo(pathID);
         gs.Save(IdVendedor.ToString());
     }
 }
Example #6
0
 public void Delete()
 {
     if (Find(this.IdCliente))
     {
         ListaClientes.Remove(this);
         GestionArchivo gs = new GestionArchivo(pathID);
         gs.Save(IdCliente.ToString());
     }
 }
Example #7
0
        private void boxAdd_Load(object sender, EventArgs e)
        {
            GestionArchivo gs = new GestionArchivo(boxAdd.PathLista);

            gs.DeleteFile();
            boxAdd.Titles    = new string[] { "Nombre", "Información" };
            boxAdd.SearchFor = "Nombre";
            boxAdd.panel     = panelListBuy;
            boxAdd.DeleteFile();
        }
Example #8
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Cliente.LoadList();
            Venta.Venta.LoadList();
            Cliente  = null;
            Vendedor = null;
            labelMessageInfoAlert.Text = "";
            GestionArchivo gs = new GestionArchivo();

            gs.Duplicate(Producto.path, "Files/CompraTemp.txt");
            ImprimirData(panelListProducts, "Files/CompraTemp.txt", Producto.Titles).Show();
            ImprimirData(panelListBuy, boxSearch.PathLista, new string[] { "Nombre", "Imformación" }).Show();
        }
Example #9
0
        private void buttonAdd_Click_1(object sender, EventArgs e)
        {
            if (textBoxSearch.Text != "")
            {
                string validationData;

                GestionArchivo gs = new GestionArchivo(PathTemp);
                gs.PathTemp = PathLista;

                int position = getPosition(Titles, SearchFor);

                validationData = gs.SearchDate(textBoxSearch.Text, position);
                if (validationData != null)
                {
                    MessageInfoAlert.ForeColor = Color.Green;
                    MessageInfoAlert.Text      = "¡Busqueda exitosa!";

                    //Actualizar cantidad y obtener precio de venta
                    int IdProducto = Convert.ToInt32(validationData.Split(',')[0]);
                    Inventario.Inventario.LoadList();
                    Inventario.Inventario item = Inventario.Inventario.Search(IdProducto);

                    if (item.Cantidad != 0)
                    {
                        item.Cantidad = item.Cantidad - 1;
                        SubTotal     += item.PrecioVenta;
                        CantidadItem++;
                        Total += item.PrecioVenta + (item.PrecioVenta * 0.19);
                        Inventario.Inventario.Update(item);
                    }
                    else
                    {
                        Inventario.Inventario.Delete(item);
                    }

                    panel.Controls.Clear();
                    ImprimirData(panel, PathLista, Titles).Show();
                }
                else
                {
                    MessageInfoAlert.ForeColor = Color.Red;
                    MessageInfoAlert.Text      = "¡No encontrado!";
                }
            }
            else
            {
                MessageInfoAlert.Text = "¡Campo vacio!";
            }
        }
Example #10
0
        public Vendedor()
        {
            Count = ListaVendedores.Count;

            GestionArchivo gs = new GestionArchivo(pathID);

            gs.CreateFile();
            string ID = gs.GetDateOne();

            if (ID != null)
            {
                IdVendedor = Convert.ToInt32(ID);
                gs.Delete(IdVendedor.ToString());
            }
            else
            {
                IdVendedor = ListaVendedores.Count + 1;
            }
        }
Example #11
0
        private FormImprimir ImprimirData(Panel panel)
        {
            FormImprimir imprimir = new FormImprimir();

            imprimir.TopLevel = false;

            GestionArchivo gs = new GestionArchivo();

            gs.Path = Venta.path;
            gs.CreateFile();

            panel.Controls.Add(imprimir);

            imprimir.TitleWindow = "Lista de Items";
            imprimir.DataInput   = gs.GetDataString();
            imprimir.Titles      = Venta.Titles;

            return(imprimir);
        }
Example #12
0
        public Inventario()//Cambio
        {
            Count = ListaInventario.Count;

            GestionArchivo gs = new GestionArchivo(pathID);

            gs.CreateFile();
            string ID = gs.GetDateOne();

            if (ID != null)
            {
                IdInventario = Convert.ToInt32(ID);
                gs.Delete(IdInventario.ToString());
            }
            else
            {
                IdInventario = ListaInventario.Count + 1;
            }
        }
Example #13
0
        public Producto()
        {
            Count = ListaProductos.Count;

            GestionArchivo gs = new GestionArchivo(pathID);

            gs.CreateFile();
            string ID = gs.GetDateOne();

            if (ID != null)
            {
                IdProducto = Convert.ToInt32(ID);
                gs.Delete(IdProducto.ToString());
            }
            else
            {
                IdProducto = ListaProductos.Count + 1;
            }
        }
Example #14
0
        public Factura()//Here
        {
            Count = ListaFactura.Count;

            GestionArchivo gs = new GestionArchivo(pathID);

            gs.CreateFile();
            string ID = gs.GetDateOne();

            if (ID != null)
            {
                IdFactura = Convert.ToInt32(ID);
                gs.Delete(IdFactura.ToString());
            }
            else
            {
                IdFactura = ListaFactura.Count + 1;
            }
        }
Example #15
0
        public Cliente()
        {
            Count = ListaClientes.Count;

            GestionArchivo gs = new GestionArchivo(pathID);

            gs.CreateFile();
            string ID = gs.GetDateOne();

            if (ID != null)
            {
                IdCliente = Convert.ToInt32(ID);
                gs.Delete(IdCliente.ToString());
            }
            else
            {
                IdCliente = ListaClientes.Count + 1;
            }
        }
Example #16
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            checkBoxMostrarInfo.Checked = true;
            modelo = new GestionArchivo();

            agregarUbicacionesCALI(true);

            //Agregando servicios
            string[] serv = modelo.darServicios();
            cmBoxServicio.Items.AddRange(serv);

            //Agregando barrios
            string[] barr = modelo.darBarrios();
            cmBoxBarrio.Items.AddRange(barr);

            //Desactivando columnas para que no aparezcan lat y ling
            dtGridCALI.Columns[1].Visible = dtGridCALI.Columns[2].Visible = false;

            latitud          = 3.3419134;
            longitud         = -76.5306936;
            gmap.DragButton  = MouseButtons.Left;
            gmap.CanDragMap  = true;
            gmap.MapProvider = GMapProviders.GoogleMap;
            gmap.Position    = new PointLatLng(DEFAULT_LAT, DEFAULT_LONG);
            gmap.MinZoom     = 12;
            gmap.MaxZoom     = 18;
            gmap.Zoom        = gmap.MinZoom;
            gmap.AutoScroll  = true;
            //Marcador
            markerOverlay = new GMapOverlay("Marcador");
            marker        = new GMarkerGoogle(new PointLatLng(latitud, longitud), GMarkerGoogleType.blue);
            markerUser    = new GMarkerGoogle(new PointLatLng(DEFAULT_LAT, DEFAULT_LONG), GMarkerGoogleType.orange);
            markerOverlay.Markers.Add(marker); //Agregamos al mapa
            markerOverlay.Markers.Add(markerUser);
            cambiarCuadroTextoMarcadorUsuario(DEFAULT_LAT, DEFAULT_LONG);
            cambiarCuadroTextoMarcador(latitud, longitud);
            gmap.Overlays.Add(markerOverlay);
            actualizarGmap();
        }
Example #17
0
        public static void Edit(int linea, object data)
        {
            GestionArchivo gs = new GestionArchivo(path);

            gs.Edit(linea, data);
        }
Example #18
0
        public static void Delete(object data)
        {
            GestionArchivo gs = new GestionArchivo(path);

            gs.Delete(data);
        }
Example #19
0
        public void Save()
        {
            GestionArchivo gs = new GestionArchivo(path);

            gs.Save(this.GetLine());
        }
Example #20
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            Console.ReadLine();

            //Instanciando clases
            var gestor                    = new GestionArchivo();
            var escribir                  = new EscribirArchivo();
            var enumerar                  = new  EnumerarArchivo();
            var crearDirectorio           = new CrearDirectorios();
            var informar                  = new  InformarCaracteristicas();
            var escucharArchivo           = new  EscucharArchivo();
            var tamañoArchivosParalelismo = new TamañoArchivosParalelismo();



            //Rutas definidas para cada método
            //Ruta del gestor
            var ruta = @"/home/elmer2210/Escritorio/POO/ManejoArchvio/Nuestro Juramento.txt";
            //Ruta del archivo a escribir
            var archivoEcribir = @"/home/elmer2210/Escritorio/POO/ManejoArchvio/Escribe Aqui.txt";
            //Ruta para crear directorios
            var directorio = @"/home/elmer2210/Escritorio/POO/ManejoArchvio/";


            //Leer un archivo
            var contenido = gestor.Leer(ruta);

            Console.WriteLine("Nuestro Juramento");
            Console.WriteLine(contenido);

            //Agregar entradar a un archivo
            var crear = escribir.Escribir(archivoEcribir);

            Console.ReadLine();
            Console.WriteLine(crear);

            //enumerar los archivos de un directorio
            var enumerando = enumerar.Enumerar(directorio);

            Console.ReadLine();
            Console.WriteLine(enumerando);

            //crear directorio y subdirectorios
            var crearDirectorios = crearDirectorio.CrearDirectorio();

            Console.ReadLine();
            Console.WriteLine(crearDirectorios);

            //Dar caracteristicas de un archivo con drive
            var decirCaracteristicas = informar.Informar(directorio);

            //Usando el trace Listeners
            var escuchar = escucharArchivo.Escuchar();

            Console.ReadLine();
            Console.WriteLine(escuchar);

            //paralelismo para contar archivos
            Console.WriteLine(tamañoArchivosParalelismo.LeerArchivo());
        }
Example #21
0
        public void DeleteFile()
        {
            GestionArchivo gs = new GestionArchivo();

            gs.DeleteFile();
        }