private void incarcaRand(DataGridViewRow pRand, BClientiComenzi pElem)
        {
            pRand.Tag = pElem;

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

            pRand.Cells[EnumColoaneDGV.colCodComanda.ToString()].Value = pElem.CodLucrare;
            pRand.Cells[EnumColoaneDGV.colClinica.ToString()].Value    = pElem.DenumireClinica;
            pRand.Cells[EnumColoaneDGV.colMedic.ToString()].Value      = pElem.GetIdentitateMedic();
            pRand.Cells[EnumColoaneDGV.colCabinet.ToString()].Value    = pElem.DenumireCabinet;
            pRand.Cells[EnumColoaneDGV.colLucrare.ToString()].Value    = pElem.DenumireLucrare;
            pRand.Cells[EnumColoaneDGV.colNrElemente.ToString()].Value = pElem.NrElemente.ToString();
            pRand.Cells[EnumColoaneDGV.colValoare.ToString()].Value    = pElem.ValoareFinala;
            pRand.Cells[EnumColoaneDGV.colMoneda.ToString()].Value     = pElem.GetEtichetaMoneda();
            if (pElem.DataLaGata != CConstante.DataNula)
            {
                pRand.Cells[EnumColoaneDGV.colDataLaGata.ToString()].Value = pElem.DataLaGata;
            }
            else
            {
                pRand.Cells[EnumColoaneDGV.colDataLaGata.ToString()].Value = string.Empty;
            }

            pRand.Cells[EnumColoaneDGV.colStareEtapa.ToString()].Value   = pElem.StatusEtapaEticheta;
            pRand.Cells[EnumColoaneDGV.colEtapaCurenta.ToString()].Value = pElem.DenumireEtapa;
            pRand.Cells[EnumColoaneDGV.colTehnician.ToString()].Value    = pElem.GetIdentitateTehnician();
            pRand.Cells[EnumColoaneDGV.colPacient.ToString()].Value      = pElem.GetNumePrenumePacient();

            DataGridViewPersonalizat.InitCelulaDeschideClasic(pRand, EnumColoaneDGV.colDetaliiClinica.ToString());
            DataGridViewPersonalizat.InitCelulaDeschideClasic(pRand, EnumColoaneDGV.colDetaliiFisa.ToString());
        }
예제 #2
0
        private void incarcaRand(DataGridViewRow pRand, BClientiComenzi pElem)
        {
            pRand.Tag = pElem;

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

            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.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);
            pRand.Cells[EnumColoaneDGV.colValoareFinala.ToString()].Value = CUtil.GetValoareMonetara(pElem.ValoareFinala, pElem.Moneda);
        }