Esempio n. 1
0
 private void tvMenu_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Enter)
         {
             AbreForm();
         }
     }
     catch (Exception ex)
     {
         new HLPexception(ex);
     }
     finally
     {
         if (e.KeyCode == Keys.Enter)
         {
             timer1.Stop();
             frmStatusServico = null;
             if (T != null)
             {
                 if (T.IsAlive)
                 {
                     T.Abort();
                     T = null;
                 }
             }
         }
     }
 }
Esempio n. 2
0
        private void frmPrincipal_KeyDown(object sender, KeyEventArgs e)
        {
            bool ok = false;

            try
            {
                if (Acesso.NM_RAMO != Acesso.BancoDados.TRANSPORTE)
                {
                    if (e.Modifiers == Keys.Control && e.KeyCode == Keys.N)
                    {
                        AbreFormNfe();
                        ok = true;
                    }
                    else if (e.Modifiers == Keys.Control && e.KeyCode == Keys.S)
                    {
                        AbreFormNfes();
                        ok = true;
                    }
                }
                else
                {
                    if (e.Modifiers == Keys.Control && e.KeyCode == Keys.T)
                    {
                        AbreFormCte();
                        ok = true;
                    }
                    if (e.Modifiers == Keys.Control && e.KeyCode == Keys.M)
                    {
                        AbreFormMDFe();
                        ok = true;
                    }
                }
                if ((e.Modifiers == Keys.Control && e.KeyCode == Keys.F) && !Acesso.bESCRITA)
                {
                    AbreFormConfig();
                }
            }
            catch (Exception ex)
            {
                new HLPexception(ex);
            }
            finally
            {
                if (ok)
                {
                    timer1.Stop();
                    frmStatusServico = null;
                    if (T != null)
                    {
                        if (T.IsAlive)
                        {
                            T.Abort();
                            T = null;
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        private void AbreFormNfes()
        {
            bool ok = false;

            if (Acesso.tipoWsNfse != Acesso.TP_WS_NFSE.NENHUM)
            {
                foreach (Control crt in this.splitContainerTela.Panel2.Controls)
                {
                    if (crt is frmGeraArquivoNFes)
                    {
                        crt.BringToFront();
                        ((Form)crt).WindowState = FormWindowState.Normal;
                        ok = true;
                        break;
                    }
                }
                if (!ok)
                {
                    timer1.Start();
                    T = new Thread(belStatusServico.VerificaStatusInternetNFs);
                    T.Start();
                    frmStatusServico = new frmStatus();
                    frmStatusServico.ShowDialog();

                    if (!belStatusServico.ServicoOperando)
                    {
                        KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    if (belStatusServico.ServicoOperando)
                    {
                        if (!(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.SUSESU))
                        {
                            belStatusServico.SelecionaCertificadoNFs();
                        }
                        frmGeraArquivoNFes objfrmNfes = new frmGeraArquivoNFes();
                        this.AddOwnedForm(objfrmNfes);
                        objfrmNfes.MdiParent = this;
                        this.splitContainerTela.Panel2.Controls.Add(objfrmNfes);
                        objfrmNfes.WindowState = FormWindowState.Normal;
                        objfrmNfes.Dock        = DockStyle.Fill;
                        objfrmNfes.Show();
                        objfrmNfes.BringToFront();
                        objfrmNfes.PesquisaNotas();
                    }
                }
            }
            else
            {
                KryptonMessageBox.Show("Módulo de Nota fiscal de serviço não liberado para a Cidade de " + Acesso.CIDADE_EMPRESA, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 4
0
        private void AbreFormManifestacaoNfe()
        {
            bool ok = false;

            foreach (Control crt in this.splitContainerTela.Panel2.Controls)
            {
                if (crt is frmManifestacaoEvento)
                {
                    crt.BringToFront();
                    ((Form)crt).WindowState = FormWindowState.Normal;
                    ok = true;
                    break;
                }
            }
            if (!ok)
            {
                if (Acesso.TP_EMIS != 2)
                {
                    timer1.Start();
                    T = new Thread(belStatusServico.VerificaStatusServicoNFeTela);
                    T.Start();
                    frmStatusServico = new frmStatus();
                    frmStatusServico.ShowDialog();
                    KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    belStatusServico.ServicoOperando = true;
                }


                if (belStatusServico.ServicoOperando)
                {
                    frmManifestacaoEvento objfrmNfe = new frmManifestacaoEvento();
                    this.AddOwnedForm(objfrmNfe);
                    objfrmNfe.MdiParent = this;
                    this.splitContainerTela.Panel2.Controls.Add(objfrmNfe);
                    objfrmNfe.WindowState = FormWindowState.Normal;
                    objfrmNfe.Dock        = DockStyle.Fill;
                    objfrmNfe.Show();
                    objfrmNfe.BringToFront();
                    objfrmNfe.Pesquisa();
                }
            }
            BuscaDtVencimentoCertificado();
        }
Esempio n. 5
0
        private void AbreFormCte()
        {
            bool ok = false;

            foreach (Control crt in this.splitContainerTela.Panel2.Controls)
            {
                if (crt is frmGerarArquivosCte)
                {
                    crt.BringToFront();
                    ((Form)crt).WindowState = FormWindowState.Normal;
                    ok = true;
                    break;
                }
            }
            if (!ok)
            {
                timer1.Start();
                T = new Thread(belStatusServico.VerificaStatusServicoCteTela);
                T.Start();
                frmStatusServico = new frmStatus();
                frmStatusServico.ShowDialog();

                KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (belStatusServico.ServicoOperando)
                {
                    frmGerarArquivosCte objfrmCte = new frmGerarArquivosCte();
                    this.AddOwnedForm(objfrmCte);
                    objfrmCte.MdiParent = this;
                    this.splitContainerTela.Panel2.Controls.Add(objfrmCte);
                    objfrmCte.WindowState = FormWindowState.Normal;
                    objfrmCte.Dock        = DockStyle.Fill;
                    objfrmCte.Show();
                    objfrmCte.BringToFront();
                    objfrmCte.PesquisaConhecimentos();
                }
            }
        }
Esempio n. 6
0
        private void frmPrincipal_KeyDown(object sender, KeyEventArgs e)
        {
            bool ok = false;
            try
            {
                if (Acesso.NM_RAMO != Acesso.BancoDados.TRANSPORTE)
                {
                    if (e.Modifiers == Keys.Control && e.KeyCode == Keys.N)
                    {
                        AbreFormNfe();
                        ok = true;
                    }
                    else if (e.Modifiers == Keys.Control && e.KeyCode == Keys.S)
                    {
                        AbreFormNfes();
                        ok = true;
                    }
                }
                else
                {
                    if (e.Modifiers == Keys.Control && e.KeyCode == Keys.T)
                    {
                        AbreFormCte();
                        ok = true;
                    }
                    if (e.Modifiers == Keys.Control && e.KeyCode == Keys.M)
                    {
                        AbreFormMDFe();
                        ok = true;
                    }
                }
                if ((e.Modifiers == Keys.Control && e.KeyCode == Keys.F) && !Acesso.bESCRITA)
                {
                    AbreFormConfig();
                }
            }
            catch (Exception ex)
            {
                new HLPexception(ex);
            }
            finally
            {
                if (ok)
                {
                    timer1.Stop();
                    frmStatusServico = null;
                    if (T != null)
                    {
                        if (T.IsAlive)
                        {
                            T.Abort();
                            T = null;
                        }
                    }
                }
            }

        }
Esempio n. 7
0
        private void tvMenu_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    AbreForm();
                }
            }
            catch (Exception ex)
            {
                new HLPexception(ex);
            }
            finally
            {
                if (e.KeyCode == Keys.Enter)
                {
                    timer1.Stop();
                    frmStatusServico = null;
                    if (T != null)
                    {
                        if (T.IsAlive)
                        {
                            T.Abort();
                            T = null;
                        }
                    }
                }
            }

        }
Esempio n. 8
0
        private void AbreFormNfes()
        {
            bool ok = false;
            if (Acesso.tipoWsNfse != Acesso.TP_WS_NFSE.NENHUM)
            {

                foreach (Control crt in this.splitContainerTela.Panel2.Controls)
                {
                    if (crt is frmGeraArquivoNFes)
                    {
                        crt.BringToFront();
                        ((Form)crt).WindowState = FormWindowState.Normal;
                        ok = true;
                        break;
                    }
                }
                if (!ok)
                {

                    timer1.Start();
                    T = new Thread(belStatusServico.VerificaStatusInternetNFs);
                    T.Start();
                    frmStatusServico = new frmStatus();
                    frmStatusServico.ShowDialog();

                    if (!belStatusServico.ServicoOperando)
                    {
                        KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    if (belStatusServico.ServicoOperando)
                    {
                        if (!(Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.SUSESU))
                        {
                            belStatusServico.SelecionaCertificadoNFs();
                        }
                        frmGeraArquivoNFes objfrmNfes = new frmGeraArquivoNFes();
                        this.AddOwnedForm(objfrmNfes);
                        objfrmNfes.MdiParent = this;
                        this.splitContainerTela.Panel2.Controls.Add(objfrmNfes);
                        objfrmNfes.WindowState = FormWindowState.Normal;
                        objfrmNfes.Dock = DockStyle.Fill;
                        objfrmNfes.Show();
                        objfrmNfes.BringToFront();
                        objfrmNfes.PesquisaNotas();
                    }
                }
            }
            else
            {
                KryptonMessageBox.Show("Módulo de Nota fiscal de serviço não liberado para a Cidade de " + Acesso.CIDADE_EMPRESA, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

        }
Esempio n. 9
0
        private void AbreFormManifestacaoNfe()
        {

            bool ok = false;
            foreach (Control crt in this.splitContainerTela.Panel2.Controls)
            {
                if (crt is frmManifestacaoEvento)
                {
                    crt.BringToFront();
                    ((Form)crt).WindowState = FormWindowState.Normal;
                    ok = true;
                    break;
                }
            }
            if (!ok)
            {
                if (Acesso.TP_EMIS != 2)
                {
                    timer1.Start();
                    T = new Thread(belStatusServico.VerificaStatusServicoNFeTela);
                    T.Start();
                    frmStatusServico = new frmStatus();
                    frmStatusServico.ShowDialog();
                    KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    belStatusServico.ServicoOperando = true;
                }


                if (belStatusServico.ServicoOperando)
                {
                    frmManifestacaoEvento objfrmNfe = new frmManifestacaoEvento();
                    this.AddOwnedForm(objfrmNfe);
                    objfrmNfe.MdiParent = this;
                    this.splitContainerTela.Panel2.Controls.Add(objfrmNfe);
                    objfrmNfe.WindowState = FormWindowState.Normal;
                    objfrmNfe.Dock = DockStyle.Fill;
                    objfrmNfe.Show();
                    objfrmNfe.BringToFront();
                    objfrmNfe.Pesquisa();
                }
            }
            BuscaDtVencimentoCertificado();

        }
Esempio n. 10
0
        private void AbreFormCte()
        {
            bool ok = false;
            foreach (Control crt in this.splitContainerTela.Panel2.Controls)
            {
                if (crt is frmGerarArquivosCte)
                {
                    crt.BringToFront();
                    ((Form)crt).WindowState = FormWindowState.Normal;
                    ok = true;
                    break;
                }
            }
            if (!ok)
            {
                timer1.Start();
                T = new Thread(belStatusServico.VerificaStatusServicoCteTela);
                T.Start();
                frmStatusServico = new frmStatus();
                frmStatusServico.ShowDialog();

                KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (belStatusServico.ServicoOperando)
                {
                    frmGerarArquivosCte objfrmCte = new frmGerarArquivosCte();
                    this.AddOwnedForm(objfrmCte);
                    objfrmCte.MdiParent = this;
                    this.splitContainerTela.Panel2.Controls.Add(objfrmCte);
                    objfrmCte.WindowState = FormWindowState.Normal;
                    objfrmCte.Dock = DockStyle.Fill;
                    objfrmCte.Show();
                    objfrmCte.BringToFront();
                    objfrmCte.PesquisaConhecimentos();
                }
            }
        }
Esempio n. 11
0
        private void AbreForm()
        {
            try
            {
                if (tvMenu.SelectedNode != null)
                {
                    Boolean ok = false;
                    TreeNode nodeItem = tvMenu.SelectedNode;

                    if (nodeItem.Tag != null)
                    {
                        switch (nodeItem.Tag.ToString())
                        {
                            #region CTe

                            case "Status Cte":

                                timer1.Start();
                                T = new Thread(belStatusServico.VerificaStatusServicoCTe);
                                T.Start();
                                frmStatusServico = new frmStatus();
                                frmStatusServico.ShowDialog();

                                KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);

                                break;

                            case "frmInutilizaFaixaCte":

                                if (Acesso.cert_CTe == null || !belStatusServico.ServicoOperando)
                                {
                                    timer1.Start();
                                    T = new Thread(belStatusServico.VerificaStatusServicoCteTela);
                                    T.Start();
                                    frmStatusServico = new frmStatus();
                                    frmStatusServico.ShowDialog();

                                    KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                                if (belStatusServico.ServicoOperando && Acesso.TP_EMIS != 2)
                                {
                                    frmInutilizaFaixaCte objfrm = new frmInutilizaFaixaCte();
                                    objfrm.ShowDialog();
                                }
                                break;


                            case "frmGerarArquivosCte":
                                AbreFormCte();
                                break;
                            case "frmGerarArquivosMDFe":
                                AbreFormMDFe();
                                break;
                            #endregion

                            #region NFe
                            case "Status Nfe":

                                timer1.Start();
                                T = new Thread(belStatusServico.VerificaStatusServicoNFe);
                                T.Start();
                                frmStatusServico = new frmStatus();
                                frmStatusServico.ShowDialog();

                                KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            case "frmInutilizaFaixaNFe":
                                if (Acesso.cert_NFe == null || !belStatusServico.ServicoOperando)
                                {
                                    timer1.Start();
                                    T = new Thread(belStatusServico.VerificaStatusServicoNFeTela);
                                    T.Start();
                                    frmStatusServico = new frmStatus();
                                    frmStatusServico.ShowDialog();

                                    KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                                if (belStatusServico.ServicoOperando && Acesso.TP_EMIS != 2)
                                {
                                    frmInutilizaFaixaNFe objfrm = new frmInutilizaFaixaNFe();
                                    objfrm.ShowDialog();
                                }
                                break;
                            case "frmProtocolosNfe":
                                frmProtocolosNfe objfrmProt = new frmProtocolosNfe();
                                objfrmProt.ShowDialog();
                                break;

                            case "frmGeraArquivoNFe":
                                AbreFormNfe();
                                break;
                            case "frmManifestacaoEvento":
                                AbreFormManifestacaoNfe();
                                break;
                            #endregion

                            #region NFe Servico

                            case "frmGeraArquivoNFes":
                                AbreFormNfes();
                                break;
                            #endregion

                            #region CCe
                            case "frmGeraArquivoCCe":
                                foreach (Control crt in this.splitContainerTela.Panel2.Controls)
                                {
                                    if (crt is frmGeraArquivoCCe)
                                    {
                                        crt.BringToFront();
                                        ((Form)crt).WindowState = FormWindowState.Normal;
                                        ok = true;
                                        break;
                                    }
                                }
                                if (!ok)
                                {
                                    timer1.Start();
                                    T = new Thread(belStatusServico.VerificaStatusServicoNFeTela);
                                    T.Start();
                                    frmStatusServico = new frmStatus();
                                    frmStatusServico.ShowDialog();

                                    KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);

                                    if (Acesso.TP_EMIS == 1)
                                    {
                                        if (belStatusServico.ServicoOperando)
                                        {
                                            frmGeraArquivoCCe objfrmCCe = new frmGeraArquivoCCe();
                                            this.AddOwnedForm(objfrmCCe);
                                            objfrmCCe.MdiParent = this;
                                            this.splitContainerTela.Panel2.Controls.Add(objfrmCCe);
                                            objfrmCCe.WindowState = FormWindowState.Normal;
                                            objfrmCCe.Dock = DockStyle.Fill;
                                            objfrmCCe.Show();
                                            objfrmCCe.BringToFront();
                                            objfrmCCe.PesquisaCartas();
                                        }
                                    }
                                } break;
                            #endregion
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                new HLPexception(ex);
            }
            finally
            {
                timer1.Stop();
                frmStatusServico = null;
                if (T != null)
                {
                    if (T.IsAlive)
                    {
                        T.Abort();
                        T = null;
                    }
                }
            }
        }
Esempio n. 12
0
        private void AbreForm()
        {
            try
            {
                if (tvMenu.SelectedNode != null)
                {
                    Boolean  ok       = false;
                    TreeNode nodeItem = tvMenu.SelectedNode;

                    if (nodeItem.Tag != null)
                    {
                        switch (nodeItem.Tag.ToString())
                        {
                            #region CTe

                        case "Status Cte":

                            timer1.Start();
                            T = new Thread(belStatusServico.VerificaStatusServicoCTe);
                            T.Start();
                            frmStatusServico = new frmStatus();
                            frmStatusServico.ShowDialog();

                            KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);

                            break;

                        case "frmInutilizaFaixaCte":

                            if (Acesso.cert_CTe == null || !belStatusServico.ServicoOperando)
                            {
                                timer1.Start();
                                T = new Thread(belStatusServico.VerificaStatusServicoCteTela);
                                T.Start();
                                frmStatusServico = new frmStatus();
                                frmStatusServico.ShowDialog();

                                KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            if (belStatusServico.ServicoOperando && Acesso.TP_EMIS != 2)
                            {
                                frmInutilizaFaixaCte objfrm = new frmInutilizaFaixaCte();
                                objfrm.ShowDialog();
                            }
                            break;


                        case "frmGerarArquivosCte":
                            AbreFormCte();
                            break;

                        case "frmGerarArquivosMDFe":
                            AbreFormMDFe();
                            break;
                            #endregion

                            #region NFe
                        case "Status Nfe":

                            timer1.Start();
                            T = new Thread(belStatusServico.VerificaStatusServicoNFe);
                            T.Start();
                            frmStatusServico = new frmStatus();
                            frmStatusServico.ShowDialog();

                            KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            break;

                        case "frmInutilizaFaixaNFe":
                            if (Acesso.cert_NFe == null || !belStatusServico.ServicoOperando)
                            {
                                timer1.Start();
                                T = new Thread(belStatusServico.VerificaStatusServicoNFeTela);
                                T.Start();
                                frmStatusServico = new frmStatus();
                                frmStatusServico.ShowDialog();

                                KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            if (belStatusServico.ServicoOperando && Acesso.TP_EMIS != 2)
                            {
                                frmInutilizaFaixaNFe objfrm = new frmInutilizaFaixaNFe();
                                objfrm.ShowDialog();
                            }
                            break;

                        case "frmProtocolosNfe":
                            frmProtocolosNfe objfrmProt = new frmProtocolosNfe();
                            objfrmProt.ShowDialog();
                            break;

                        case "frmGeraArquivoNFe":
                            AbreFormNfe();
                            break;

                        case "frmManifestacaoEvento":
                            AbreFormManifestacaoNfe();
                            break;
                            #endregion

                            #region NFe Servico

                        case "frmGeraArquivoNFes":
                            AbreFormNfes();
                            break;
                            #endregion

                            #region CCe
                        case "frmGeraArquivoCCe":
                            foreach (Control crt in this.splitContainerTela.Panel2.Controls)
                            {
                                if (crt is frmGeraArquivoCCe)
                                {
                                    crt.BringToFront();
                                    ((Form)crt).WindowState = FormWindowState.Normal;
                                    ok = true;
                                    break;
                                }
                            }
                            if (!ok)
                            {
                                timer1.Start();
                                T = new Thread(belStatusServico.VerificaStatusServicoNFeTela);
                                T.Start();
                                frmStatusServico = new frmStatus();
                                frmStatusServico.ShowDialog();

                                KryptonMessageBox.Show(belStatusServico.Mensagem, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);

                                if (Acesso.TP_EMIS == 1)
                                {
                                    if (belStatusServico.ServicoOperando)
                                    {
                                        frmGeraArquivoCCe objfrmCCe = new frmGeraArquivoCCe();
                                        this.AddOwnedForm(objfrmCCe);
                                        objfrmCCe.MdiParent = this;
                                        this.splitContainerTela.Panel2.Controls.Add(objfrmCCe);
                                        objfrmCCe.WindowState = FormWindowState.Normal;
                                        objfrmCCe.Dock        = DockStyle.Fill;
                                        objfrmCCe.Show();
                                        objfrmCCe.BringToFront();
                                        objfrmCCe.PesquisaCartas();
                                    }
                                }
                            }
                            break;
                            #endregion
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                new HLPexception(ex);
            }
            finally
            {
                timer1.Stop();
                frmStatusServico = null;
                if (T != null)
                {
                    if (T.IsAlive)
                    {
                        T.Abort();
                        T = null;
                    }
                }
            }
        }