private void comboBox3_DropDownClosed(object sender, EventArgs e) { ComboBox combo = (ComboBox)sender; var value = combo.SelectedValue; if (value == null) { return; } labelValContratto.Text = (from c in db.ContrattoVendita where c.Numero == EntryForm.convertStringInt(value.ToString()) select c.ImportoComplessivo).First().ToString(); }
private void comboBox2_DropDownClosed(object sender, EventArgs e) { ComboBox combo = (ComboBox)sender; var value = combo.SelectedValue; if (value == null) { return; } dataGridViewRevisioni.DataSource = from v in this.db.VeicoloVenduto join r in db.Revisione on v.Id equals r.VeicoloVenduto where v.Id == EntryForm.convertStringInt(value.ToString()) && r.DataEsecuzione != null select new { r.Numero, r.DataEsecuzione }; }