Example #1
0
        private void BtnFiscalizeaza_Click(object sender, EventArgs e)
        {
            if (this.lSeIncarca)
            {
                return;
            }
            try
            {
                incepeIncarcarea();

                BLocatii firma        = BLocatii.GetLocatieCurenta();
                string   serieFactura = firma.SerieFacturi;

                if (serieFactura == string.Empty)
                {
                    Mesaj.Informare(this.GetFormParinte(), string.Format("{0}: {1}", BMultiLingv.getElementById(BMultiLingv.EnumDictionar.NuExistaSerieFacturaAlocataPeLocatie), firma.Denumire), BMultiLingv.getElementById(BMultiLingv.EnumDictionar.Facturare));
                }
                else
                {
                    this.lFactura.Fiscalizeaza(null);

                    inchideEcranulOK();
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
            finally
            {
                finalizeazaIncarcarea();
            }
        }
Example #2
0
        public static void Imprima(Form pEcranParinte, BClientiFacturi pFactura)
        {
            if (pFactura == null)
            {
                return;
            }

            lFactura        = pFactura;
            lLocatieFiscala = BLocatii.GetLocatieCurenta();

            //Selectam imprimanta
            using (PrintDocument imprimanta = SetupThePrinting(pEcranParinte, pFactura.ToStringImprimare()))
            {
                if (imprimanta != null)
                {
                    lLiniiRegistru = pFactura.GetListaLucrari(null);

                    using (PrintPreviewDialog ppDialog = new PrintPreviewDialog())
                    {
                        ppDialog.ShowIcon = false;
                        ppDialog.Document = imprimanta;

                        CCL.UI.IHMUtile.DeschideEcran(pEcranParinte, ppDialog);
                    }
                }
            }
        }
Example #3
0
        public void Fiscalizeaza(IDbTransaction pTranzactie)
        {
            IDbTransaction Tranzactie = null;

            try
            {
                if (pTranzactie == null)
                {
                    Tranzactie = CCL.DAL.CCerereSQL.GetTransactionOnConnection();
                }
                else
                {
                    Tranzactie = pTranzactie;
                }

                BLocatii firma = BLocatii.GetLocatieCurenta();

                this.SerieFactura = firma.SerieFacturi;
                this.NumarFactura = firma.NumarUltimaFactura + 1;
                this.UpdateAll(Tranzactie);

                firma.NumarUltimaFactura = this.NumarFactura;
                firma.UpdateAll(Tranzactie);

                if (pTranzactie == null)
                {
                    //Facem Comit tranzactiei doar daca aceasta nu a fost transmisa in parametru. Altfel comitul va fi gestionat de functia apelanta
                    CCL.DAL.CCerereSQL.CloseTransactionOnConnection(Tranzactie, true);
                }
            }
            catch (Exception)
            {
                if ((pTranzactie == null) && (Tranzactie != null))
                {
                    CCL.DAL.CCerereSQL.CloseTransactionOnConnection(Tranzactie, false);
                }
                throw;
            }
        }