Example #1
0
        internal bool Salveaza()
        {
            bool esteValid = BLocatii.SuntInformatiileNecesareCoerente(this.txtDenumireLocatie.Text, this.cboTipLocatie.SelectedIndex);

            if (this.lLocatie == null)
            {
                if (esteValid)
                {
                    BLocatii.Add(this.txtDenumireLocatie.Text, this.cboTipLocatie.SelectedIndex, 0, 0, 0, 0, 0, this.txtTelefonMobilLocatie.Text, this.txtFaxLocatie.Text, this.txtSkypeLocatie.Text, this.txtContYMLocatie.Text, this.txtMailLocatie.Text, this.txtPaginaWebLocatie.Text, this.txtInfoContactLocatie.Text, this.picLogoLocatie.ImageLocation, 0, this.txtDenumireFiscalaLocatie.Text, getTipFiscalitate(), this.txtCodFiscalLocatie.Text, this.txtNrInregistrareLocatie.Text, this.txtIbanLocatie.Text, this.txtBancaLocatie.Text, this.txtReprezentantLegalLocatie.Text, this.txtCalitateReprezentantLocatie.Text, this.txtSerieChitanteLocatie.Text, CUtil.GetAsInt32(this.txtNrInregistrareLocatie.Text), this.txtSerieFacturiLocatie.Text, 0, this.chkTvaLocatie.Checked, this.txtInitialaLocatie.Text, 0, this.ctrlGestiuneCuloareLocatie.CuloareARGB, null);
                }
                else
                {
                    seteazaAlerta();
                }
            }
            else
            {
                this.lLocatie.Denumire                  = this.txtDenumireLocatie.Text;
                this.lLocatie.InitialaLocatie           = this.txtInitialaLocatie.Text;
                this.lLocatie.TipLocatie                = this.cboTipLocatie.SelectedIndex;
                this.lLocatie.Culoare                   = this.ctrlGestiuneCuloareLocatie.CuloareARGB;
                this.lLocatie.InfoContact               = this.txtInfoContactLocatie.Text;
                this.lLocatie.AdresaMail                = this.txtMailLocatie.Text;
                this.lLocatie.ContSkype                 = this.txtSkypeLocatie.Text;
                this.lLocatie.Fax                       = this.txtFaxLocatie.Text;
                this.lLocatie.ContYM                    = this.txtContYMLocatie.Text;
                this.lLocatie.PaginaWeb                 = this.txtPaginaWebLocatie.Text;
                this.lLocatie.TelefonMobil              = this.txtTelefonMobilLocatie.Text;
                this.lLocatie.DenumireFiscala           = this.txtDenumireFiscalaLocatie.Text;
                this.lLocatie.Logo                      = this.picLogoLocatie.ImageLocation;
                this.lLocatie.TipFiscalitate            = getTipFiscalitate();
                this.lLocatie.PlatitorDeTVA             = this.chkTvaLocatie.Checked;
                this.lLocatie.CodFiscal                 = this.txtCodFiscalLocatie.Text;
                this.lLocatie.NumarInregistrare         = this.txtNrInregistrareLocatie.Text;
                this.lLocatie.ContIBAN                  = this.txtIbanLocatie.Text;
                this.lLocatie.DenumireBanca             = this.txtBancaLocatie.Text;
                this.lLocatie.ReprezentantLegal         = this.txtReprezentantLegalLocatie.Text;
                this.lLocatie.CalitateReprezentantLegal = this.txtCalitateReprezentantLocatie.Text;
                this.lLocatie.SerieChitante             = this.txtSerieChitanteLocatie.Text;
                this.lLocatie.NumarUltimaChitanta       = CUtil.GetAsInt32(this.txtNrUltimaChitantaLocatie.Text);
                this.lLocatie.SerieFacturi              = this.txtSerieFacturiLocatie.Text;
                this.lLocatie.NumarUltimaFactura        = CUtil.GetAsInt32(this.txtNrUltimaFacturaLocatie.Text);
                if (esteValid)
                {
                    this.lLocatie.UpdateAll();
                }
                else
                {
                    seteazaAlerta();
                }
            }
            return(esteValid);
        }