private void incarcaRandCategorie(BCategorii pCategorie)
        {
            TreeGridNode NodCategorie = this.tgvListaCategorii.CreazaNod(-1);

            NodCategorie.Tag = pCategorie;

            TreeGridNode NodAdauga       = null;
            TreeGridNode NodSubCategorie = null;

            var listaSubcategorii = BCategorii.GetListByParamSubcategorii(pCategorie.Id, CDL.iStomaLab.CDefinitiiComune.EnumStare.Activa, null);

            if (pCategorie != null)
            {
                TreeGridView.InitCelulaEditare(NodCategorie, this.lEcranInModificare);
                NodCategorie.Cells[EnumColTGV.colDenumire.ToString()].Value = pCategorie.Denumire;
                NodCategorie.DefaultCellStyle.Font = new Font(this.tgvListaCategorii.Font, FontStyle.Bold);
                NodCategorie.Cells[EnumColTGV.colCuloare.ToString()].Style.BackColor = BDefinitiiGenerale.getCuloareDinARGB(pCategorie.Culoare);
                NodCategorie.Cells[EnumColTGV.colCuloare.ToString()].Tag             = pCategorie.Culoare;
                TreeGridView.InitCelulaStergere(NodCategorie);

                NodAdauga = NodCategorie.CreazaNod(-1);
                incarcaRandAdaugaSubcategorie(NodAdauga, pCategorie);

                if (listaSubcategorii.Count > 0)
                {
                    foreach (var subcategorie in listaSubcategorii)
                    {
                        NodSubCategorie = NodCategorie.CreazaNod(-1);
                        incarcaRandSubcategorie(NodSubCategorie, subcategorie);
                    }
                }
            }

            NodCategorie.Expand();
        }
Example #2
0
        private void incarcaRandCategorie(BCategorii pCategorie)
        {
            TreeGridNode NodCategorie = this.tgvListaCategorii.CreazaNod(-1);

            NodCategorie.Tag = pCategorie;

            TreeGridNode NodSubCategorie = null;

            if (pCategorie != null)
            {
                var listaSubcategorii = BCategorii.GetListByParamSubcategorii(pCategorie.Id, CDL.iStomaLab.CDefinitiiComune.EnumStare.Activa, null);

                NodCategorie.Cells[EnumColTGV.colDenumire.ToString()].Value = pCategorie.Denumire;
                NodCategorie.DefaultCellStyle.Font = new Font(this.tgvListaCategorii.Font, FontStyle.Bold);

                if (listaSubcategorii.Count > 0)
                {
                    foreach (var subcategorie in listaSubcategorii)
                    {
                        NodSubCategorie = NodCategorie.CreazaNod(-1);
                        incarcaRandSubcategorie(NodSubCategorie, subcategorie);
                    }
                }
            }
        }
        private void ConstruiesteRanduriDGV()
        {
            this.dgvListaCategorii.IncepeContructieRanduri();
            BColectieCategorii listaElem = null;

            if (this.lIdCategorieParinte <= 0)
            {
                listaElem = BCategorii.GetListByParamCategorii(CDL.iStomaLab.CDefinitiiComune.EnumStare.Activa, null);
            }
            else
            {
                listaElem = BCategorii.GetListByParamSubcategorii(this.lIdCategorieParinte, CDL.iStomaLab.CDefinitiiComune.EnumStare.Activa, null);
            }

            foreach (var elem in listaElem)
            {
                incarcaRand(this.dgvListaCategorii.Rows[this.dgvListaCategorii.Rows.Add()], elem);
            }

            this.dgvListaCategorii.FinalizeazaContructieRanduri();

            this.lblNrElemente.Text = listaElem.Count + " elemente";
        }