Esempio n. 1
0
        private void CtrlValidareAnulare_Validare(object sender, EventArgs e)
        {
            if (this.lSeIncarca)
            {
                return;
            }
            try
            {
                incepeIncarcarea();

                BColectieClienti listaClientiExistenti = BClienti.GetListByParam(CDL.iStomaLab.CDefinitiiComune.EnumStare.Activa, null);

                //List<string> listaDenumireClientiExistenti = listaClientiExistenti.GetDenumireClienti();

                foreach (DataGridViewRow row in this.dgvListaImportClienti.Rows)
                {
                    StructImportClienti client = (StructImportClienti)row.Tag;

                    BClienti clinicaExistenta = listaClientiExistenti.GetPrimaByDenumire(client.DenumireCabinet.ToLower());

                    if (!string.IsNullOrEmpty(client.DenumireCabinet))
                    {
                        if (clinicaExistenta == null)
                        {
                            int idClient = BClienti.Add(client.DenumireCabinet, null);
                            listaClientiExistenti.Add(new BClienti(idClient));

                            BClientiReprezentanti.Add(idClient, client.NumeClient, client.PrenumeClient, string.Empty, null);
                        }
                        else
                        {
                            //Tuple<int, string> listeClientiExistentiDenumire = BClienti.getListaClientiDenumire(client.DenumireCabinet);

                            //List<string> lstMediciExistentiDenumire = BClientiReprezentanti.getListaMediciDenumire(listeClientiExistentiDenumire.Item1);

                            //if (!lstMediciExistentiDenumire.Contains(client.NumeClient + " " + client.PrenumeClient))
                            //{
                            BClientiReprezentanti.Add(clinicaExistenta.Id, client.NumeClient, client.PrenumeClient, string.Empty, null);
                            //}
                        }
                    }
                }

                inchideEcranulOK();
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
            finally
            {
                finalizeazaIncarcarea();
            }
        }
        internal bool Salveaza()
        {
            bool esteValid = BClientiReprezentanti.SuntInformatiileNecesareCoerente(this.lClient.Id, this.txtNumeReprezentant.Text);

            if (this.lReprezentant == null)
            {
                if (esteValid)
                {
                    BClientiReprezentanti.Add(this.lClient.Id, this.txtCnpReprezentant.Text, this.txtNumeReprezentant.Text, this.txtPrenumeReprezentant.Text, this.ctrlDataNasteriiReprezentant.DataAfisata, getSexSelectat(), this.cboTitulaturaReprezentant.SelectedIndex, this.txtNumeDeFataReprezentant.Text, this.txtSupranumeReprezentant.Text, this.txtTelefonMobilReprezentant.Text, this.txtTelefonFixReprezentant.Text, this.txtFaxReprezentant.Text, this.txtSkypeReprezentant.Text, this.txtContYMReprezentant.Text, this.txtEmailReprezentant.Text, this.cboRolReprezentant.SelectedIndex, this.cboStareCivilaReprezentant.SelectedIndex, this.cboNrCopiiReprezentant.SelectedIndex, this.txtScoalaReprezentant.Text, 0, this.ctrlTara.IdObiectAfisajCorespunzator, 0, 0, this.ctrlProfesie.IdObiectAfisajCorespunzator, this.txtObservatiiReprezentant.Text, null);
                }
                else
                {
                    seteazaAlerta();
                }
            }
            else
            {
                lReprezentant.Titulatura  = this.cboTitulaturaReprezentant.SelectedIndex;
                lReprezentant.Nume        = this.txtNumeReprezentant.Text;
                lReprezentant.Prenume     = this.txtPrenumeReprezentant.Text;
                lReprezentant.Porecla     = this.txtSupranumeReprezentant.Text;
                lReprezentant.NumeDeFata  = this.txtNumeDeFataReprezentant.Text;
                lReprezentant.Sex         = getSexSelectat();
                lReprezentant.StareCivila = this.cboStareCivilaReprezentant.SelectedIndex;
                lReprezentant.NumarCopii  = this.cboNrCopiiReprezentant.SelectedIndex;
                lReprezentant.Scoala      = this.txtScoalaReprezentant.Text;
                lReprezentant.IdProfesie  = this.ctrlProfesie.IdObiectAfisajCorespunzator;
                lReprezentant.DataNastere = this.ctrlDataNasteriiReprezentant.DataAfisata;
                //this.cboNationalitateReprezentant.DataSource=
                lReprezentant.IdTaraNastere = this.ctrlTara.IdObiectAfisajCorespunzator;
                // this.cboJudetReprezentant.DataSource=
                //this.cboLocalitateReprezentant.DataSource=
                lReprezentant.CNP          = this.txtCnpReprezentant.Text;
                lReprezentant.Rol          = this.cboRolReprezentant.SelectedIndex;
                lReprezentant.TelefonMobil = this.txtTelefonMobilReprezentant.Text;
                lReprezentant.TelefonFix   = this.txtTelefonFixReprezentant.Text;
                lReprezentant.Fax          = this.txtFaxReprezentant.Text;
                lReprezentant.AdresaMail   = this.txtEmailReprezentant.Text;
                lReprezentant.ContYM       = this.txtContYMReprezentant.Text;
                lReprezentant.ContSkype    = this.txtSkypeReprezentant.Text;
                lReprezentant.Observatii   = this.txtObservatiiReprezentant.Text;
                if (esteValid)
                {
                    this.lReprezentant.UpdateAll();
                }
                else
                {
                    seteazaAlerta();
                }
            }
            return(esteValid);
        }
Esempio n. 3
0
        internal bool Salveaza()
        {
            bool esteValid = BClientiReprezentanti.SuntInformatiileNecesareCoerente(this.lClient.Id, this.txtNumeReprezentant.Text);

            if (this.lReprezentant == null)
            {
                if (esteValid)
                {
                    BClientiReprezentanti.Add(this.lClient.Id, this.txtCnpReprezentant.Text, this.txtNumeReprezentant.Text, this.txtPrenumeReprezentant.Text, this.ctrlDataNasteriiReprezentant.DataAfisata, getSexSelectat(), this.cboTitulaturaReprezentant.SelectedIndex, string.Empty, string.Empty, this.txtTelefonMobilReprezentant.Text, string.Empty, string.Empty, string.Empty, string.Empty, this.txtEmailReprezentant.Text, CDefinitiiComune.EnumRol.MedicTitular, 0, 0, string.Empty, 0, 0, 0, 0, 0, this.txtObservatiiReprezentant.Text, null);
                }
                else
                {
                    seteazaAlerta();
                }
            }
            else
            {
                lReprezentant.Titulatura  = this.cboTitulaturaReprezentant.SelectedIndex;
                lReprezentant.Nume        = this.txtNumeReprezentant.Text;
                lReprezentant.Prenume     = this.txtPrenumeReprezentant.Text;
                lReprezentant.Sex         = getSexSelectat();
                lReprezentant.DataNastere = this.ctrlDataNasteriiReprezentant.DataAfisata;
                lReprezentant.CNP         = this.txtCnpReprezentant.Text;
                //lReprezentant.Rol = this.cboRolReprezentant.SelectedIndex;
                lReprezentant.TelefonMobil = this.txtTelefonMobilReprezentant.Text;
                lReprezentant.AdresaMail   = this.txtEmailReprezentant.Text;
                lReprezentant.Observatii   = this.txtObservatiiReprezentant.Text;
                if (esteValid)
                {
                    this.lReprezentant.UpdateAll();
                }
                else
                {
                    seteazaAlerta();
                }
            }
            return(esteValid);
        }
Esempio n. 4
0
        internal bool Salveaza()
        {
            bool esteOk = false;

            if (this.ctrlCautaClinica.AreValoare())
            {
                esteOk = BClientiReprezentanti.SuntInformatiileNecesareCoerente(this.ctrlCautaClinica.IdObiectAfisajCorespunzator, this.txtNume.Text);

                if (esteOk)
                {
                    BClientiReprezentanti.Add(this.ctrlCautaClinica.IdObiectAfisajCorespunzator, this.txtNume.Text, this.txtPrenume.Text, this.txtTelefon.Text, null);
                }
                else
                {
                    seteazaAlerta();
                }
            }
            else
            {
                seteazaAlerta();
            }
            return(esteOk);
        }