private void ConstruiesteRanduriDGV() { this.dgvListaVenituri.IncepeContructieRanduri(); BColectieUtilizator listaUtilizatori = BUtilizator.GetListByParam(CDefinitiiComune.EnumStare.Activa, CDefinitiiComune.EnumRol.Nedefinit, null); BColectieUtilizatoriVenituri listaVenituri = BUtilizatoriVenituri.getByListaId(listaUtilizatori.GetListaId(), null); Dictionary <int, Tuple <double, double> > dictTotal = BClientiComenziEtape.GetListaVenituri(this.ctrlPerioada.DataInceput, this.ctrlPerioada.DataSfarsit, null); foreach (var elem in listaUtilizatori) { incarcaRand(this.dgvListaVenituri.Rows[this.dgvListaVenituri.Rows.Add()], elem, listaVenituri.GetVenituriActiveInPerioada(elem.Id, this.ctrlPerioada.DataInceput, this.ctrlPerioada.DataSfarsit), dictTotal.ContainsKey(elem.Id) ? dictTotal[elem.Id] : null); } this.lblTotal.Text = string.Format("{0}: {1}", BMultiLingv.getElementById(BMultiLingv.EnumDictionar.ElementeGasite), this.dgvListaVenituri.RowCount.ToString()); this.dgvListaVenituri.FinalizeazaContructieRanduri(); }
private void incarcaRand(DataGridViewRow pRand, BUtilizator pElem, BColectieUtilizatoriVenituri pVenituri, Tuple <double, double> pTotal) { pRand.Tag = pElem; pRand.Cells[EnumColoaneDGV.colTehnician.ToString()].Value = pElem.GetNumeCompletUtilizator(); if (!CUtil.EsteListaVida <BUtilizatoriVenituri>(pVenituri)) { pRand.Cells[EnumColoaneDGV.colTipVenit.ToString()].Value = pVenituri.ToString(); } this.dgvListaVenituri.SeteazaFontIngrosat(pRand, EnumColoaneDGV.colTotal.ToString()); if (pTotal != null) { DataGridViewPersonalizat.InitCelulaValoareMonetara(pRand, EnumColoaneDGV.colNrElemente.ToString(), pTotal.Item1); DataGridViewPersonalizat.InitCelulaValoareMonetara(pRand, EnumColoaneDGV.colTotal.ToString(), pTotal.Item2); } DataGridViewPersonalizat.InitCelulaDeschideClasic(pRand, EnumColoaneDGV.colDetalii.ToString()); }