public static void SetCursBNR()
 {
     if (!GetSeFolosesteCursBNRSetatDeUser())
     {
         double curs = BDefinitiiGenerale.getCursLeuEur(null);
         SetCursBNR(curs);
     }
 }
        private void incarcaRand(DataGridViewRow pRand, BUtilizator pElem)
        {
            pRand.Tag = pElem;

            DataGridViewPersonalizat.InitCelulaEditare(pRand, this.lEcranInModificare);
            pRand.Cells[EnumColoaneDGV.colCuloare.ToString()].Style.BackColor = BDefinitiiGenerale.getCuloareDinARGB(pElem.Culoare);
            pRand.Cells[EnumColoaneDGV.colNume.ToString()].Value    = pElem.Nume;
            pRand.Cells[EnumColoaneDGV.colPrenume.ToString()].Value = pElem.Prenume;
            if (CUtil.isNotNull(pElem.DataNastere))
            {
                pRand.Cells[EnumColoaneDGV.colDataNastere.ToString()].Value = pElem.DataNastere;
            }
            pRand.Cells[EnumColoaneDGV.colTelefonFix.ToString()].Value = pElem.TelefonFix;
            pRand.Cells[EnumColoaneDGV.colCnp.ToString()].Value        = pElem.CNP;
            DataGridViewPersonalizat.InitCeluleTelefonEmail(pRand, pElem.TelefonMobil, pElem.AdresaMail);
            DataGridViewPersonalizat.InitCelulaStergere(pRand);
        }
        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();
        }
        private void TgvListaCategorii_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.lSeIncarca)
            {
                return;
            }
            try
            {
                incepeIncarcarea();

                if (e.ColumnIndex == 0 && e.RowIndex == -1)
                {
                    foreach (var node in this.tgvListaCategorii.Nodes)
                    {
                        if (areToateNodurileExpandate(node))
                        {
                            this.tgvListaCategorii.CollapseAll();
                            break;
                        }
                        else
                        {
                            this.tgvListaCategorii.ExpandAll();
                            break;
                        }
                    }
                }

                BCategorii celulaSelectata = this.tgvListaCategorii.CurrentNode.Tag as BCategorii;

                if (celulaSelectata != null && celulaSelectata.IdCategorie == 0)
                {
                    this.tgvListaCategorii.CurrentNode.Cells[EnumColTGV.colCuloare.ToString()].Style.SelectionBackColor = BDefinitiiGenerale.getCuloareDinARGB(celulaSelectata.Culoare);
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
            finally
            {
                finalizeazaIncarcarea();
            }
        }
        private void DgvListaUtilizatori_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.lSeIncarca)
            {
                return;
            }
            try
            {
                incepeIncarcarea();

                BUtilizator utilizatorSelectat = this.dgvListaUtilizatori.CurrentRow.Tag as BUtilizator;

                if (utilizatorSelectat != null)
                {
                    this.dgvListaUtilizatori.CurrentRow.Cells[1].Style.SelectionBackColor = BDefinitiiGenerale.getCuloareDinARGB(utilizatorSelectat.Culoare);
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
            finally
            {
                finalizeazaIncarcarea();
            }
        }
Beispiel #6
0
        private void incarcaRand(DataGridViewRow pRand, BClientiComenzi pElem)
        {
            pRand.Tag = pElem;
            //asa era initial  pRand.Tag = new Tuple<BClientiComenzi, BListaPreturiStandard, BListaPreturiClienti>(pElem, pElem2, pElemClient);

            idclient  = pElem.IdClient;
            idlucrare = pElem.IdLucrare;

            DataGridViewPersonalizat.InitCelulaEditare(pRand, this.lEcranInModificare);

            DataGridViewPersonalizat.SeteazaCuloareFundalCelula(pRand, EnumColoaneDGV.colCuloareTehnician.ToString(), BDefinitiiGenerale.getCuloareDinARGB(pElem.CuloareTehnician));
            pRand.Cells[EnumColoaneDGV.colCuloareTehnician.ToString()].ToolTipText = pElem.GetIdentitateTehnician();

            pRand.Cells[EnumColoaneDGV.colCodLucrareClient.ToString()].Value = pElem.Id;

            pRand.Cells[EnumColoaneDGV.colCodComanda.ToString()].Value = pElem.CodLucrare;
            pRand.Cells[EnumColoaneDGV.colClient.ToString()].Value     = pElem.GetDenumireClinicaCabinet();

            DataGridViewPersonalizat.InitCelulaDeschideClasic(pRand, EnumColoaneDGV.colFisaClient.ToString());

            if (pElem.IdReprezentantClient != 0)
            {
                pRand.Cells[EnumColoaneDGV.colMedic.ToString()].Value = pElem.GetIdentitateMedic();
            }
            else
            {
                pRand.Cells[EnumColoaneDGV.colMedic.ToString()].Value = string.Empty;
            }
            if (pElem.Urgent)
            {
                DataGridViewPersonalizat.SeteazaAlerta(pRand, EnumColoaneDGV.colLucrare.ToString());
                pRand.Cells[EnumColoaneDGV.colLucrare.ToString()].ToolTipText = string.Format("{0} - {1}", BMultiLingv.getElementById(BMultiLingv.EnumDictionar.Urgent), pElem.DenumireLucrare);
            }
            else
            {
                DataGridViewPersonalizat.IndeparteazaAlerta(pRand, EnumColoaneDGV.colLucrare.ToString());
                pRand.Cells[EnumColoaneDGV.colLucrare.ToString()].ToolTipText = pElem.DenumireLucrare;
            }

            pRand.Cells[EnumColoaneDGV.colCuloare.ToString()].Value    = pElem.Culoare;
            pRand.Cells[EnumColoaneDGV.colLucrare.ToString()].Value    = pElem.GetDenumirePrescurtata();
            pRand.Cells[EnumColoaneDGV.colNrElemente.ToString()].Value = pElem.NrElemente.ToString();

            if (pElem.IdEtapaCurenta != 0)
            {
                pRand.Cells[EnumColoaneDGV.colEtapaCurenta.ToString()].Value = pElem.DenumireEtapa;
            }
            else
            {
                pRand.Cells[EnumColoaneDGV.colEtapaCurenta.ToString()].Value = string.Empty;
            }

            if (pElem.Refacere)
            {
                DataGridViewPersonalizat.SeteazaAlerta(pRand, EnumColoaneDGV.colEtapaCurenta.ToString());
                pRand.Cells[EnumColoaneDGV.colEtapaCurenta.ToString()].ToolTipText = BMultiLingv.getElementById(BMultiLingv.EnumDictionar.Refacere);
            }
            else
            {
                DataGridViewPersonalizat.IndeparteazaAlerta(pRand, EnumColoaneDGV.colEtapaCurenta.ToString());
            }

            if (pElem.IdTehnician != 0)
            {
                pRand.Cells[EnumColoaneDGV.colTehnician.ToString()].Value = pElem.GetIdentitateTehnician();
            }
            else
            {
                pRand.Cells[EnumColoaneDGV.colTehnician.ToString()].Value = string.Empty;
            }

            pRand.Cells[EnumColoaneDGV.colStare.ToString()].Value = pElem.StatusEtapaEticheta;

            if (pElem.DataSfarsitEtapa != CConstante.DataNula)
            {
                pRand.Cells[EnumColoaneDGV.colTermen.ToString()].Value       = pElem.DataSfarsitEtapa;
                pRand.Cells[EnumColoaneDGV.colTermen.ToString()].ToolTipText = CUtil.GetNumeZiSaptamana(pElem.DataSfarsitEtapa.DayOfWeek);
                if (pElem.DataSfarsitEtapa <= DateTime.Today && !pElem.Acceptata)
                {
                    DataGridViewPersonalizat.SeteazaAlerta(pRand, EnumColoaneDGV.colTermen.ToString());
                }
                else
                {
                    DataGridViewPersonalizat.IndeparteazaAlerta(pRand, EnumColoaneDGV.colTermen.ToString());
                }
            }

            DataGridViewPersonalizat.InitCelulaDeschideClasic(pRand, EnumColoaneDGV.colTotalEtape.ToString());

            pRand.Cells[EnumColoaneDGV.colDataPrimire.ToString()].Value = pElem.DataPrimire;
            if (pElem.DataLaGata != CConstante.DataNula)
            {
                pRand.Cells[EnumColoaneDGV.colDataLaGata.ToString()].Value = pElem.DataLaGata;
            }
            else
            {
                pRand.Cells[EnumColoaneDGV.colDataLaGata.ToString()].Value = string.Empty;
            }

            if (pElem.DataLaGata.Date <= DateTime.Today && !pElem.Acceptata)
            {
                DataGridViewPersonalizat.SeteazaAlerta(pRand, EnumColoaneDGV.colDataLaGata.ToString());
            }
            else
            {
                DataGridViewPersonalizat.IndeparteazaAlerta(pRand, EnumColoaneDGV.colDataLaGata.ToString());
            }
            pRand.Cells[EnumColoaneDGV.colNumePacient.ToString()].Value = pElem.GetNumePrenumePacient();
            pRand.Cells[EnumColoaneDGV.colObservatii.ToString()].Value  = pElem.Observatii;
            pRand.Cells[EnumColoaneDGV.colDataCreare.ToString()].Value  = pElem.DataCreare;

            if (pElem.IdFactura > 0)
            {
                DataGridViewPersonalizat.SeteazaOK(pRand, EnumColoaneDGV.colNumePacient.ToString());
            }

            BListaPreturiClienti pElemClient = BListaPreturiClienti.GetPretClient(pElem.IdLucrare, pElem.IdClient, CDL.iStomaLab.CDefinitiiComune.EnumStare.Activa, null);

            pRand.Cells[EnumColoaneDGV.colMoneda.ToString()].Value          = pElem.GetEtichetaMoneda();
            pRand.Cells[EnumColoaneDGV.colValoareInitiala.ToString()].Value = CUtil.GetValoareMonetara(pElem.ValoareInitiala, pElem.Moneda);

            double pretLista    = pElem.ValoareInitiala;
            double pretNegociat = pElem.ValoareFinala;
            double diferenta    = pretLista - pretNegociat;
            double ajustare     = CUtil.GetProcentDinTotal(diferenta, pretLista);

            pRand.Cells[EnumColoaneDGV.colDiscount.ToString()].Value = CUtil.GetValoareMonetara(ajustare);  // BListaPreturiClienti.GetEtichetaAjustare();

            //daca este reducere, atunci % cu minus si alerta text cu rosu
            if (pretNegociat < pretLista)
            {
                DataGridViewPersonalizat.SeteazaAlerta(pRand, EnumColoaneDGV.colDiscount.ToString());
            }
            else
            {
                DataGridViewPersonalizat.IndeparteazaAlerta(pRand, EnumColoaneDGV.colDiscount.ToString());
            }

            pRand.Cells[EnumColoaneDGV.colValoareFinala.ToString()].Value = CUtil.GetValoareMonetara(pElem.ValoareFinala, pElem.Moneda);
            DataGridViewPersonalizat.InitCelulaStergere(pRand);
        }