private void elencoProdotti(char from) { clsProdotto prodotto = new clsProdotto("Inquinamento.mdf"); if (from == 'L') { tabellaProdotti = prodotto.lista(' '); } else if (chkAggiungiAnnullateProdotti.Checked == true) { tabellaProdotti = prodotto.lista('A'); } else { tabellaProdotti = prodotto.lista(' '); } cmbProdotti.DataSource = tabellaProdotti; cmbProdotti.DisplayMember = "NomeProdotto"; cmbProdotti.ValueMember = "CodProdotto"; cmbProdotti.SelectedIndex = -1; dgvProdotti.DataSource = tabellaProdotti; prodotto.Dispose(); annulla_Prodotti(); }
private void elencoProdotti(char tipo) { // Gestione dei Dati delle AZIENDE clsProdotto prodotto = new clsProdotto("Inquinamento.mdf"); // Recupero le Azienda dal DB if (tipo == 'L') { tabella = prodotto.lista(' '); } else { if (chkProdottiAnnullati.Checked) { tabella = prodotto.lista('A'); } else { tabella = prodotto.lista(' '); } } // carico le Aziende sulla comboBox cmbProdotti.DataSource = tabella; cmbProdotti.DisplayMember = "NomeProdotto"; cmbProdotti.ValueMember = "CodProdotto"; cmbProdotti.SelectedIndex = -1; // Carico le Aziende sulla DGV dgvProdotti.DataSource = tabella; dgvProdotti.ClearSelection(); prodotto.Dispose(); }
private string[] caricaProdottoScarico() { clsProdotto prodotto = new clsProdotto("Inquinamento.mdf"); // Recupero le Azienda dal DB tabella = prodotto.lista(' '); string[] s = new string[tabella.Rows.Count]; for (int i = 0; i < s.Length; i++) { s[i] = tabella.Rows[i].ItemArray[1].ToString(); } return(s); }
private string getCodProd(string Prod) { clsProdotto prodotto = new clsProdotto("Inquinamento.mdf"); tabella = prodotto.lista(' '); for (int i = 0; i < tabella.Rows.Count; i++) { if (tabella.Rows[i].ItemArray[1].ToString() == Prod) { return(tabella.Rows[i].ItemArray[0].ToString()); } } return(string.Empty); }
private void caricaComboBox() { //recupero le aziende clsAzienda azi = new clsAzienda("Inquinamento.mdf"); DataTable tabAziende = azi.lista(' '); //inserisco nelle comboBox i nomi delle entità cmbCodAzienda.DataSource = tabAziende; cmbCodAzienda.ValueMember = "CodAzienda"; cmbCodAzienda.DisplayMember = "NomeAzienda"; cmbCodAzienda.SelectedIndex = -1; azi.Dispose(); //recuperocgli inquinanti clsInquinante inq = new clsInquinante("Inquinamento.mdf"); DataTable tabInq = inq.lista(' '); //inserisco nelle comboBox i nomi delle entità cmbCodInq.DataSource = tabInq; cmbCodInq.ValueMember = "CodInquinante"; cmbCodInq.DisplayMember = "NomeInquinante"; cmbCodInq.SelectedIndex = -1; inq.Dispose(); //recupero i prodotti clsProdotto prod = new clsProdotto("Inquinamento.mdf"); DataTable tabProd = prod.lista(' '); //inserisco nelle comboBox i nomi delle entità cmbCodProd.DataSource = tabProd; cmbCodProd.ValueMember = "CodProdotto"; cmbCodProd.DisplayMember = "NomeProdotto"; cmbCodProd.SelectedIndex = -1; prod.Dispose(); }