private void BtnDeschide_Click(object sender, EventArgs e)
        {
            if (this.lSeIncarca)
            {
                return;
            }
            try
            {
                incepeIncarcarea();

                BClienti client = FormListaClinici.Afiseaza(this.GetFormParinte());
                if (client != null)
                {
                    this.Initializeaza(new StructIdDenumire(client.Id, BClienti.getClient(client.Id, null).Denumire), this.lTipDeschidere);
                    ascundeEcranCautare();
                    anuntaSelectia();
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
            finally
            {
                finalizeazaIncarcarea();
            }
        }
        private void incarcaRand(DataGridViewRow pRand, BClientiComenzi pElem)
        {
            pRand.Tag = pElem;

            DataGridViewPersonalizat.InitCelulaEditare(pRand, this.lEcranInModificare);
            pRand.Cells[EnumColoaneDGV.colClient.ToString()].Value       = BClienti.getClient(pElem.IdClient, null).Denumire;
            pRand.Cells[EnumColoaneDGV.colReprezentant.ToString()].Value = BClientiReprezentanti.getNumeCompletReprezentant(BClientiReprezentanti.getReprezentant(pElem.IdReprezentantClient, null));
            pRand.Cells[EnumColoaneDGV.colDataPrimire.ToString()].Value  = pElem.DataPrimire;
            pRand.Cells[EnumColoaneDGV.colDataLaGata.ToString()].Value   = pElem.DataLaGata;
            pRand.Cells[EnumColoaneDGV.colObservatii.ToString()].Value   = pElem.Observatii;
        }
Beispiel #3
0
        public void SelectieInteligenta(int pIdClient)
        {
            if (this.GetIdClient() == pIdClient)
            {
                this.Goleste();
            }
            else
            {
                this.lgfClinica.ObiectAfisajCorespunzator = BClienti.getClient(pIdClient, null);
            }

            cereUpdate();
        }
        private void DgvLista_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.lSeIncarca || e.RowIndex < 0)
            {
                return;
            }
            try
            {
                incepeIncarcarea();

                string denumireColoanaSelectata = this.dgvLista.Columns[e.ColumnIndex].Name;

                if (this.dgvLista.SelectedRow != null)
                {
                    BClientiComenzi comandaSelectata = this.dgvLista.SelectedRow.Tag as BClientiComenzi;
                    if (comandaSelectata != null)
                    {
                        if (denumireColoanaSelectata.Equals(EnumColoaneDGV.colFisaClient.ToString()))
                        {
                            BClienti client = BClienti.getClient(comandaSelectata.IdClient, null);

                            if (TablouDeBord.Clienti.FormDosarClient.Afiseaza(this.GetFormParinte(), client))
                            {
                                incarcaRand(this.dgvLista.SelectedRow, comandaSelectata);
                            }
                        }
                        else if (denumireColoanaSelectata.Equals(EnumColoaneDGV.colTotalEtape.ToString()))
                        {
                            if (FormLucrareListaEtapeRealizate.Afiseaza(this.GetFormParinte(), comandaSelectata))
                            {
                                comandaSelectata.Refresh(null);
                                incarcaRand(this.dgvLista.SelectedRow, comandaSelectata);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
            finally
            {
                finalizeazaIncarcarea();
            }
        }
        private void DgvLista_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.lSeIncarca || e.RowIndex < 0)
            {
                return;
            }
            try
            {
                incepeIncarcarea();

                string denumireColoanaSelectata = this.dgvLista.Columns[e.ColumnIndex].Name;

                BClientiComenziEtape etapaSelectata = this.dgvLista.SelectedRow.Tag as BClientiComenziEtape;

                if (etapaSelectata != null)
                {
                    if (denumireColoanaSelectata.Equals(EnumColoaneDGV.colDeschideClinica.ToString()) && etapaSelectata.IdClient != 0)
                    {
                        if (TablouDeBord.Clienti.FormDosarClient.Afiseaza(this.GetFormParinte(), BClienti.getClient(etapaSelectata.IdClient, null)))
                        {
                            incarcaRand(this.dgvLista.SelectedRow, etapaSelectata);
                        }
                    }
                    else if (denumireColoanaSelectata.Equals(EnumColoaneDGV.colDeschideLucrare.ToString()) && etapaSelectata.IdLucrare != 0)
                    {
                        BClientiComenzi       comanda = BClientiComenzi.getComanda(etapaSelectata.IdComandaClient, null);
                        BClienti              client  = BClienti.getClient(etapaSelectata.IdClient, null);
                        BListaPreturiStandard lucrare = BListaPreturiStandard.getById(etapaSelectata.IdLucrare, null);

                        if (TablouDeBord.Clienti.FormDetaliuComanda.Afiseaza(this.GetFormParinte(), comanda, client, lucrare))
                        {
                            incarcaRand(this.dgvLista.SelectedRow, etapaSelectata);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
            finally
            {
                finalizeazaIncarcarea();
            }
        }
        private void BtnAchita_Click(object sender, EventArgs e)
        {
            if (this.lSeIncarca)
            {
                return;
            }
            try
            {
                incepeIncarcarea();

                BColectieClientiComenzi listaLucrari = this.dgvLista.GetListaObiecteBifate <BColectieClientiComenzi, BClientiComenzi>();

                BClienti client = this.ctrlCautareClinica.GetClient();
                if (client == null)
                {
                    if (this.dgvLista.SelectedRows.Count == 1)
                    {
                        BClientiComenzi comanda = this.dgvLista.SelectedRow.Tag as BClientiComenzi;
                        client = BClienti.getClient(comanda.IdClient, null);
                    }
                    else
                    {
                        int idClient = listaLucrari.GetIdClientDinLista();
                        if (idClient != 0)
                        {
                            client = BClienti.getClient(idClient, null);
                        }
                    }
                }

                if (FormCreeazaFacturaClient.Afiseaza(this.GetFormParinte(), client, listaLucrari, null))
                {
                    ConstruiesteRanduriDGV();
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
            finally
            {
                finalizeazaIncarcarea();
            }
        }
Beispiel #7
0
        private void afiseazaCautare()
        {
            BClienti pClient = this.lIdClient > 0 ? new BClienti(this.lIdClient) : BClienti.getClient(this.lIdClient, null);

            if (this.lEcranCautare == null)
            {
                this.lEcranCautare = new frmAfiseazaRezultatCautarePacient(pClient, pPacient, this.txtCautarePacient.Text);
                this.lEcranCautare.AplicaPreferintele();
                this.lEcranCautare.ElementSelectat += lEcranCautare_ElementSelectat;
                CCL.UI.IHMUtile.StabilesteLocatia(this.lEcranCautare, this.txtCautare, false, this.lTipDeschidere, false);
                this.lEcranCautare.InchideEcranul += lEcranCautare_InchideEcranul;
            }
            else
            {
                this.lEcranCautare.AplicaPreferintele();
                CCL.UI.IHMUtile.StabilesteLocatia(this.lEcranCautare, this.txtCautare, false, this.lTipDeschidere, false);
                this.lEcranCautare.Initializeaza(lIdClient, this.txtCautare.Text);
            }
            this.lEcranCautare.Show();
        }
        public static bool Afiseaza(Form pEcranPariente, int pIdComandaClient, ref int pIdPacient, string denumpac)
        {
            BClienti         pClient  = pIdComandaClient > 0 ? new BClienti(pIdComandaClient) : BClienti.getClient(pIdComandaClient, null);
            BClientiPacienti pPacient = pIdPacient > 0 ?  BClientiPacienti.getPacient(pIdPacient, null) : null;
            string           Denumire = denumpac;

            using (FormDetaliuPacient ecran = new FormDetaliuPacient(pClient, pPacient, Denumire))
            {
                ecran.AplicaPreferinteleUtilizatorului();

                if (CCL.UI.IHMUtile.DeschideEcran(pEcranPariente, ecran))
                {
                    return(false);
                }
                else
                {
                    //cand adauga un pacient nou din control
                    pIdPacient = ecran.pPacient.Id;
                }
            }
            return(true);
        }
Beispiel #9
0
        private void DgvListaComenzi_EditareLinie(DataGridViewPersonalizat pDGVSende, int pIndexRand)
        {
            this.modedit = true;

            if (this.lSeIncarca)
            {
                return;
            }
            try
            {
                incepeIncarcarea();
                /// lore 02.09.2019
                //  Tuple<BClientiComenzi, BListaPreturiClienti> comandaDeModificat = this.dgvListaComenzi.Rows[pIndexRand].Tag as Tuple<BClientiComenzi, BListaPreturiClienti>;
                //  BListaPreturiStandard pretstandard = BListaPreturiStandard.getById(comandaDeModificat.Item1.IdLucrare, null);
                ///////////////////////
                BClientiComenzi comandaDeModificat = this.dgvListaComenzi.Rows[pIndexRand].Tag as BClientiComenzi;
                if (comandaDeModificat != null) //&& !this.btnActivDezactivat.Selectat
                {
                    BListaPreturiStandard lucrare = BListaPreturiStandard.getById(comandaDeModificat.IdLucrare, null);

                    if (TablouDeBord.Clienti.FormDetaliuComanda.Afiseaza(this.GetFormParinte(), comandaDeModificat, BClienti.getClient(comandaDeModificat.IdClient, null), lucrare))
                    {
                        incarcaRand(this.dgvListaComenzi.Rows[pIndexRand], comandaDeModificat); //, pretstandard, comandaDeModificat.Item2);   /// lore 02.09.2019
                    }
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
            finally
            {
                finalizeazaIncarcarea();
            }
        }
        private void DgvListaComenzi_EditareLinie(DataGridViewPersonalizat pDGVSender, int pIndexRand)
        {
            if (this.lSeIncarca)
            {
                return;
            }
            try
            {
                incepeIncarcarea();

                BClientiComenzi comandaDeModificat = this.dgvListaComenzi.Rows[pIndexRand].Tag as BClientiComenzi;
                if (comandaDeModificat != null)
                {
                    if (TablouDeBord.Clienti.FormDetaliuComanda.Afiseaza(this.GetFormParinte(), comandaDeModificat, BClienti.getClient(comandaDeModificat.IdClient, null)))
                    {
                        incarcaRand(this.dgvListaComenzi.Rows[pIndexRand], comandaDeModificat);
                    }
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
            finally
            {
                finalizeazaIncarcarea();
            }
        }