Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Alquiler alquiler = new Alquiler();

            alquiler.Carne   = textBoxCarne.Text;
            alquiler.Libro   = textBoxCodigo.Text;
            alquiler.Entrada = dateTimePickerEntrada.Value;
            alquiler.Salida  = dateTimePickerEntrada.Value;

            alquileres.Add(alquiler);
            Guardar();
        }
Example #2
0
        private void Reporte_Load(object sender, EventArgs e)
        {
            if (File.Exists(@"..\..\libros.txt"))
            {
                FileStream   stream = new FileStream(@"..\..\libros.txt", FileMode.Open, FileAccess.Read);
                StreamReader reader = new StreamReader(stream);
                while (reader.Peek() > -1)
                {
                    libros libro = new libros();
                    Libros.Add(libro);
                }
                reader.Close();
            }
            if (File.Exists(@"..\..\estudiantes.txt"))
            {
                FileStream   stream = new FileStream(@"..\..\estudiantes.txt", FileMode.Open, FileAccess.Read);
                StreamReader reader = new StreamReader(stream);

                while (reader.Peek() > -1)
                {
                    datos_estudiante estudiante = new datos_estudiante();
                    estudiantes.Add(estudiante);
                }
                reader.Close();
            }

            if (File.Exists(@"..\..\alquiler.txt"))
            {
                FileStream   stream = new FileStream(@"..\..\alquiler.txt", FileMode.Open, FileAccess.Read);
                StreamReader reader = new StreamReader(stream);

                while (reader.Peek() > -1)
                {
                    Alquiler alquiler = new Alquiler();
                    alquileres.Add(alquiler);
                }
                reader.Close();
            }
        }