Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            libro reg = new libro();

            reg.codigo  = int.Parse(txtcodigo.Text);
            reg.autor   = txtAutor.Text;
            reg.año     = int.Parse(txtanio.Text);
            reg.materia = cboMateria.Text;
            reg.titulo  = txttitulow.Text;

            lib.Add(reg);
        }
Esempio n. 2
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            libro l = lib.Find(x => x.codigo == int.Parse(txtcodigo.Text));

            if (lib == null)
            {
                MessageBox.Show("Codigo no exixtente");
            }
            else
            {
                lib.Remove(l);
            }
        }