private void button1_Click(object sender, EventArgs e) { foreach (CDCDS.CDC_BRANDSRow riga in _DS.CDC_BRANDS.Rows) { if (riga.RowState == DataRowState.Added || riga.RowState == DataRowState.Modified) { riga.UTENTE = Contesto.Utente.FULLNAMEUSER; riga.DATARIFERIMENTO = DateTime.Now; } } CDCBLL bll = new CDCBLL(); bll.SalvaDatiBrands(_DS); _DS.AcceptChanges(); _DS.CDC_BRANDS.Clear(); bll.CaricaBrands(_DS); DataTable listBrands = _DS.CDC_BRANDS.Clone(); listBrands = _DS.CDC_BRANDS.Copy(); DataGridViewComboBoxColumn comboCol = (DataGridViewComboBoxColumn)dgvEnti.Columns["BRAND"]; comboCol.DataSource = listBrands; }
private void ExcelCaricaNuovoDocumentoFrm_Load(object sender, EventArgs e) { CDCBLL bll = new CDCBLL(); bll.CaricaBrands(_DS); CaricaDropDownListBrands(); }
public CreaGestioneBrandFrm() { InitializeComponent(); CDCBLL bll = new CDCBLL(); bll.CaricaBrands(_DS); bll.CaricaEnti(_DS);//JACOPO DataTable listBrands = _DS.CDC_BRANDS.Clone(); listBrands = _DS.CDC_BRANDS.Copy(); dgvBrands.ReadOnly = false; dgvBrands.AutoGenerateColumns = true; dgvBrands.DataSource = _DS; dgvBrands.DataMember = _DS.CDC_BRANDS.TableName; dgvBrands.Columns["IDBRAND"].Visible = true; dgvBrands.Columns["UTENTE"].Visible = false; dgvBrands.Columns["DATARIFERIMENTO"].Visible = false; //dgvExcelCaricato.Columns["IDDETTAGLIO"].Visible = false; //dgvExcelCaricato.Columns["IDEXCEL"].Visible = false; //dgvExcelCaricato.Columns["IDBRAND"].Visible = false; dgvEnti.ReadOnly = false; dgvEnti.AutoGenerateColumns = true; dgvEnti.DataSource = _DS; dgvEnti.DataMember = _DS.CDC_ENTI.TableName; dgvEnti.Columns["IDENTE"].Visible = false; dgvEnti.Columns["UTENTE"].Visible = false; dgvEnti.Columns["DATARIFERIMENTO"].Visible = false; dgvEnti.Columns["IDBRAND"].Visible = false; var comboCol = new DataGridViewComboBoxColumn(); comboCol.HeaderText = "BRAND"; comboCol.Name = "BRAND"; comboCol.DataPropertyName = "IDBRAND"; comboCol.AutoComplete = true; comboCol.Width = 100; comboCol.DropDownWidth = 100; comboCol.DataSource = listBrands; // _DS.CDC_BRANDS.Where(x => x.IDBRAND >0); comboCol.DisplayMember = "CODICE"; comboCol.ValueMember = "IDBRAND"; comboCol.DisplayIndex = 5; dgvEnti.Columns.Add(comboCol); }
private void btnLeggiDati_Click(object sender, EventArgs e) { lblMessaggio.Text = string.Empty; if (ddlDataCollaudo.SelectedIndex == -1) { lblMessaggio.Text = "Selezionare una data"; return; } if (ddlBrand.SelectedIndex == -1 || ddlBrand.SelectedItem.ToString() == "") { lblMessaggio.Text = "Selezionare un brand"; return; } DataCollaudoSTR dataSelezionata = new DataCollaudoSTR(ddlBrand.SelectedItem.ToString(), ddlDataCollaudo.SelectedItem.ToString()); CDCBLL bll = new CDCBLL(); _DS = new Entities.CDCDS(); bll.LeggiCollaudoDaDataSTR(_DS, dataSelezionata); bll.CaricaBrands(_DS); bll.CaricaArticoli(_DS); bll.CaricaArticoliDimensioni(_DS); bll.CaricaArticoliSpessori(_DS); if (_DS.CDC_DETTAGLIO.Count > 0) { //List<decimal> IDDETTAGLIO = _DS.CDC_DETTAGLIO.Select(x => x.IDDETTAGLIO).Distinct().ToList(); //bll.FillCDC_CONFORMITA(_DS, IDDETTAGLIO); //bll.CDC_PDF(_DS, IDDETTAGLIO); } else { lblMessaggio.Text = "Nessuna riga trovata per questa data"; } CreaDsPerDettaglio(); dgvDettaglio.ReadOnly = true; dgvDettaglio.AllowUserToDeleteRows = false; dgvDettaglio.AllowUserToAddRows = false; dgvDettaglio.AutoGenerateColumns = true; dgvDettaglio.DataSource = _dsServizio; dgvDettaglio.DataMember = tableName; dgvDettaglio.Columns["ACCESSORISTA"].Visible = false; foreach (DataGridViewRow riga in dgvDettaglio.Rows) { string parte = (string)riga.Cells["PARTE"].Value; string colore = (string)riga.Cells["COLORE"].Value; CDCDS.CDC_ARTICOLIRow arow = _DS.CDC_ARTICOLI.Where(x => x.PARTE == parte && x.COLORE == colore).FirstOrDefault(); if (arow == null) { riga.Cells[1].Style.BackColor = Color.Yellow; riga.Cells[2].Style.BackColor = Color.Yellow; } else { List <CDCDS.CDC_ARTICOLI_DIMENSIONIRow> artdimensioni = _DS.CDC_ARTICOLI_DIMENSIONI.Where(x => x.IDARTICOLO == arow.IDARTICOLO).OrderBy(x => x.IDDIMENSIONE).ToList(); List <CDCDS.CDC_ARTICOLI_SPESSORIRow> artspessori = _DS.CDC_ARTICOLI_SPESSORI.Where(x => x.IDARTICOLO == arow.IDARTICOLO).OrderBy(x => x.IDSPESSORE).ToList(); if (artspessori.Count == 0 || artdimensioni.Count == 0) { riga.Cells[1].Style.BackColor = Color.Orange; riga.Cells[2].Style.BackColor = Color.Orange; } else { riga.Cells[1].Style.BackColor = Color.White; riga.Cells[2].Style.BackColor = Color.White; } } } dgvArticoli.DataSource = null; dgvArticoli.DataMember = ""; dgvDimensioni.DataSource = null; dgvDimensioni.DataMember = ""; dgvSpessori.DataSource = null; dgvSpessori.DataMember = ""; }