Exemple #1
0
        private void btnEntrar_Click(object sender, EventArgs e)
        {
            toolStripProgressBar1.Value = 0;
            Libro Libro = new Libro();
            Libro.Libroo = txtLibro.Text;
            Libro.numLibro = int.Parse(txtNumLibro.Text);
            Libro.materia = txtMateria.Text;
            Libro.fechaEntregar = DateTime.Parse(fechaEntregar.Text);
            Libro.autor = autor.Text;
            Libro.coautor = coautor.Text;
            Libro.charola = int.Parse(textBox1.Text);
            Libro.estante = int.Parse(textBox2.Text);
            Libro.descripcion = textBox3.Text;
            if (path != "")
            {
                Libro.path = path;
                try
                {
                    System.IO.File.Copy(path, @"C:\SCB\SCB\Resources\" + nombre, true);
                }
                catch (Exception w)
                {
                    MessageBox.Show("Error al copiar el archivo! \n\n\n\n" + w.ToString());
                    return;
                }
            }

            Libro.agregaLibro(Libro);
            toolStripStatusLabel1.Text = "Usuario agregado correctamente!";
            toolStripProgressBar1.Value = 100;

            txtLibro.Text = "";
            txtNumLibro.Text = "";
            txtMateria.Text = "";
            fechaEntregar.Text = "";
            autor.Text = "";
            coautor.Text = "";
            textBox1.Text = "";
            textBox2.Text = "";
            txtNumLibro.Focus();
        }
Exemple #2
0
        private void btnEntrar_Click(object sender, EventArgs e)
        {
            Libro Libro = new Libro();
            Libro.Libroo = txtLibro.Text;
            Libro.numLibro = int.Parse(txtNumLibro.Text);
            Libro.materia = txtMateria.Text;
            Libro.fechaEntregar = DateTime.Parse(fechaEntregar.Text);
            Libro.autor = autor.Text;
            Libro.coautor = coautor.Text;
            Libro.charola = int.Parse(textBox1.Text);
            Libro.estante = int.Parse(textBox2.Text);
            Libro.agregaLibro(Libro);

            txtLibro.Text = "";
            txtNumLibro.Text = "";
            txtMateria.Text = "";
            fechaEntregar.Text = "";
            autor.Text = "";
            coautor.Text = "";
            textBox1.Text = "";
            textBox2.Text = "";
            txtNumLibro.Focus();
        }