void lEcranCautare_ElementSelectat(StructIdDenumire pElement)
        {
            try
            {
                if (pElement.Id > 0)
                {
                    this.Initializeaza(pElement, this.lTipDeschidere);
                    ascundeEcranCautare();
                    anuntaSelectia();
                }
                else
                {
                    ascundeEcranCautare();

                    ////Adaugam clientul
                    int id = BClienti.Add(pElement.Denumire, null);
                    this.lPersoanaSauOrganizatie = new BLL.iStomaLab.StructIdDenumire(id, pElement.Denumire);

                    Initializeaza(this.lPersoanaSauOrganizatie, this.lTipDeschidere);
                    anuntaSelectia();
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
        }
        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 esteOk = BClienti.SuntInformatiileNecesareCoerente(this.txtDenumire.Text);

            if (esteOk)
            {
                BClienti.Add(this.txtDenumire.Text, this.cboTipClient.SelectedIndex, this.txtDenumireFiscala.Text, this.txtCUI.Text, this.txtNrRegCom.Text, this.txtTelefonMobil.Text, this.txtTelefonFix.Text, string.Empty, string.Empty, this.txtEmail.Text, this.txtWebsite.Text, this.txtObservatiiDateClinica.Text, this.ctrlCautareRecomandant.TipObiectAfisajCorespunzator, this.ctrlCautareRecomandant.IdObiectAfisajCorespunzator, this.txtIBAN.Text, this.ctrlCautareBanca.IdObiectAfisajCorespunzator, this.txtReprezentantLegal.Text, this.cboCalitateReprezentant.SelectedIndex, CUtil.GetAsInt32(this.txtNrContract.Text), this.ctrlAlegeDataContract.DataAfisata, this.txtObservatiiDateFirma.Text, this.ctrlAgent.GetIdTehnician(), null);
            }
            else
            {
                seteazaAlerte();
            }

            return(esteOk);
        }
Exemple #4
0
        internal bool Salveaza()
        {
            bool esteValid = BClienti.SuntInformatiileNecesareCoerente(this.txtDenumireClient.Text);

            if (this.lClient == null)
            {
                if (esteValid)
                {
                    BClienti.Add(this.txtDenumireClient.Text, this.cboTipClient.SelectedIndex, this.txtDenumireFiscalaClient.Text, this.txtCUIClient.Text, this.txtRegComClient.Text, this.txtTelefonMobilClient.Text, this.txtTelefonFixClient.Text,
                                 this.txtFaxClient.Text, this.txtSkypeClient.Text, this.txtEmailClient.Text, this.txtPaginaWebClient.Text, this.txtObservatiiClient.Text, 0, 0, null);
                }
                else
                {
                    seteazaAlerta();
                }
            }
            else
            {
                this.lClient.Denumire        = this.txtDenumireClient.Text;
                this.lClient.DenumireFiscala = this.txtDenumireFiscalaClient.Text;
                this.lClient.CUI             = this.txtCUIClient.Text;
                this.lClient.RegCom          = this.txtRegComClient.Text;
                this.lClient.AdresaMail      = this.txtEmailClient.Text;
                this.lClient.PaginaWeb       = this.txtPaginaWebClient.Text;
                this.lClient.TelefonMobil    = this.txtTelefonMobilClient.Text;
                this.lClient.TelefonFix      = this.txtTelefonFixClient.Text;
                this.lClient.Fax             = this.txtFaxClient.Text;
                this.lClient.ContSkype       = this.txtSkypeClient.Text;
                this.lClient.Observatii      = this.txtObservatiiClient.Text;
                this.lClient.TipClient       = this.cboTipClient.SelectedIndex;

                if (esteValid)
                {
                    this.lClient.UpdateAll();
                }
                else
                {
                    seteazaAlerta();
                }
            }
            return(esteValid);
        }