Пример #1
0
        internal bool Salveaza()
        {
            bool esteValid = BRegiuni.SuntInformatiileNecesareCoerente(this.ctrlTara.IdObiectAfisajCorespunzator, this.txtDenumireRegiune.Text);

            if (this.lRegiune == null)
            {
                if (esteValid)
                {
                    BRegiuni.Add(this.ctrlTara.IdObiectAfisajCorespunzator, this.txtDenumireRegiune.Text, this.txtAbreviereRegiune.Text, this.txtPrefixTelefonicRegiune.Text, 1, 1, null);
                }
                else
                {
                    seteazaAlerta();
                }
            }
            else
            {
                this.lRegiune.Nume          = this.txtDenumireRegiune.Text;
                this.lRegiune.IdTara        = this.ctrlTara.IdObiectAfisajCorespunzator;
                this.lRegiune.PrefixTelefon = this.txtPrefixTelefonicRegiune.Text;
                this.lRegiune.Abreviere     = this.txtAbreviereRegiune.Text;
                if (esteValid)
                {
                    this.lRegiune.UpdateAll();
                }
                else
                {
                    seteazaAlerta();
                }
            }
            return(esteValid);
        }
Пример #2
0
        void lEcranCautare_ElementSelectat(StructIdDenumire pElement)
        {
            try
            {
                if (pElement.Id > 0)
                {
                    this.Initializeaza(this.lIdTara, pElement, this.lTipDeschidere);
                    ascundeEcranCautare();
                    anuntaSelectia();
                }
                else
                {
                    ascundeEcranCautare();

                    //Adaugam regiunea
                    int id = BRegiuni.Add(this.lIdTara, pElement.Denumire, string.Empty, string.Empty, 1, 1, null);

                    this.lPersoanaSauOrganizatie = new StructIdDenumire(id, pElement.Denumire);

                    Initializeaza(this.lIdTara, this.lPersoanaSauOrganizatie, this.lTipDeschidere);
                    anuntaSelectia();
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
        }