Пример #1
0
        private void cmbLibri_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbLibri.SelectedIndex != -1 && selezionaLibro)
            {
                clsLibro libro = new clsLibro("Biblioteca.mdf");

                libro.codice = Convert.ToInt32(cmbLibri.SelectedValue);

                libro.getDati();

                lblAutore.Text = libro.autore;
                lblGenere.Text = libro.codGenere.ToString();
                lblTitolo.Text = libro.titolo;

                clsGenere g = new clsGenere("Biblioteca.mdf");

                g.codice = libro.codGenere;
                g.getDati();
                lblGenere.Text = g.nome;

                g.dispose();

                ptbCopertina.ImageLocation = @"IMG\\" + libro.immagine;

                libro.dispose();

                cmbLettori.SelectedIndex = -1;
            }
        }
Пример #2
0
        private void cmbPrestiti_SelectedIndexChanged(object sender, EventArgs e)
        {
            //MessageBox.Show(tabellaPrestiti.Rows.ToString());
            if (selezionaPrestito && cmbPrestiti.SelectedIndex != -1 && cmbPrestiti.ValueMember != "")
            {
                grpElenco.Enabled   = false;
                grpGestione.Enabled = true;

                selezionaLibro = true;

                btnConferma.Text = "Modifica";

                chkAnnullaValditita.Enabled = true;

                clsPrestito p = new clsPrestito("Biblioteca.mdf");


                p.codice = Convert.ToInt32(cmbPrestiti.SelectedValue);
                p.getDati();

                caricaComboBox('k');

                if (p.validita == 'A')
                {
                    chkAnnullaValditita.Checked = true;
                }

                dtpPrestito.Value        = p.dataPrestito;
                cmbLettore.SelectedValue = p.codLettore;
                cmbLibro.SelectedValue   = p.codLibro;
                lblCodice.Text           = "Codice: " + p.codice;

                clsLibro l = new clsLibro("Biblioteca.mdf");

                l.codice = p.codLibro;
                l.getDati();
                pctCopertina.ImageLocation = @"IMG\\" + l.immagine;

                l.dispose();

                if (p.dataRest != DateTime.MinValue)
                {
                    dtpRestituzione.Value   = p.dataRest;
                    chkRestituito.Checked   = true;
                    dtpRestituzione.Enabled = true;
                }
                else
                {
                    chkRestituito.Checked = false;
                    chkRestituito.Enabled = true;
                }
                p.dispose();
            }
        }
Пример #3
0
        private void cmbLibro_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbLibro.SelectedIndex != -1 && selezionaLibro)
            {
                clsLibro l = new clsLibro("Biblioteca.mdf");

                //MessageBox.Show(cmbLibro.SelectedValue.ToString());

                l.codice = Convert.ToInt32(cmbLibro.SelectedValue);
                l.getDati();
                pctCopertina.ImageLocation = @"IMG\\" + l.immagine;

                l.dispose();
            }
        }
Пример #4
0
        private void cmbLibri_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbLibri.SelectedIndex != -1 && selezionaLibro)
            {
                clsLibro l = new clsLibro("Biblioteca.mdf");

                l.codice = Convert.ToInt32(cmbLibri.SelectedValue);
                l.getDati();
                lblCodice.Text = "Codice: " + l.codice;
                txtAutore.Text = l.autore;
                txtTitolo.Text = l.titolo;
                txtISBN.Text   = l.codISBNL;
                nmbAnno.Value  = Convert.ToDecimal(l.anno);
                if (l.validita == 'A')
                {
                    chkAnnullaValditita.Checked = true;
                }
                cmbGenere.SelectedValue    = l.codGenere;
                pctCopertina.ImageLocation = @"IMG\" + l.immagine;
                if (l.prestato == 'P')
                {
                    lblPrestito.Text = "Libro dato in prestito";
                }

                chkAnnullaValditita.Enabled = true;

                /*
                 * clsGenere g = new clsGenere("Biblioteca.mdf");
                 *
                 * g.codice = l.codGenere;
                 * g.getDati();
                 * cmbGenere.SelectedValue = g.codice;
                 *
                 * g.dispose();
                 */

                grpElenco.Enabled   = false;
                grpGestione.Enabled = true;
                btnConferma.Text    = "Modifica";

                l.dispose();
            }
        }
Пример #5
0
        private void cmbPrestatiNONVISIBILE_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbPrestatiNONVISIBILE.SelectedIndex != -1 && !firstRun)
            {
                clsLibro libro = new clsLibro("Biblioteca.mdf");

                libro.codice = Convert.ToInt32(cmbPrestatiNONVISIBILE.SelectedValue);

                libro.getDati();

                lblAutore.Text = libro.autore;
                lblGenere.Text = libro.codGenere.ToString();
                lblTitolo.Text = libro.titolo;

                clsGenere g = new clsGenere("Biblioteca.mdf");

                g.codice = libro.codGenere;
                g.getDati();
                lblGenere.Text = g.nome;

                g.dispose();

                clsPrestito p = new clsPrestito("Biblioteca.mdf");

                p.codLibro = libro.codice;
                p.getPrestitoFromLibro();
                lblDataPrestito.Text = p.dataPrestito.ToShortDateString();

                p.dispose();


                ptbCopertina.ImageLocation = @"IMG\\" + libro.immagine;

                libro.dispose();
            }
        }