예제 #1
0
        private void importarXMLPEscritorToolStripMenuItem_Click(object sender, EventArgs e)
        {

            Boolean ok = false;
            foreach (Form frm in this.MdiChildren)
            {
                if (frm is frmImportaEscritorNfe)
                {
                    frm.BringToFront();
                    ok = true;
                }
            }
            if (ok == false)
            {
                frmImportaEscritorNfe objfrm = new frmImportaEscritorNfe();
                objfrm.MdiParent = this;
                objfrm.Show();
            }
            else
            {
                KryptonMessageBox.Show(null, "A Tela de Importação de Notas já se encontra aberta", "A V I S O", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                lblVerificacao.Text = "Verificando atualizações. Por favor, aguarde..";
                statusStrip.Refresh();
                if (cbxArquivos.Items.Count > 0)
                {
                    belStatic.sConfig = cbxArquivos.SelectedItem.ToString();
                    Globais LeRegWin = new Globais();                    
                    belStatic.codEmpresaNFe = LeRegWin.LeRegConfig("Empresa");                   

                    if (sTipoNFe.Equals("G"))
                    {
                        belStatic.IPrimeiroLoad = 0;
                        if (cbxArquivos.SelectedItem.ToString().Replace(".xml", "").ToUpper().Equals("ESCRITA"))
                        {
                            bESCRITA = true;
                        }
                        this.Close();
                    }
                    else
                    {
                        this.Hide();
                        if (sTipoNFe.Equals("N"))
                        {
                            frmArquivosXmlNfe objfrm = new frmArquivosXmlNfe(objfrmPrincipal);
                            objfrm.MdiParent = objfrmPrincipal;
                            objfrm.Show();
                        }
                        else if (sTipoNFe.Equals("S"))
                        {
                            frmEnviaNfs objfrm = new frmEnviaNfs(objfrmPrincipal);
                            objfrm.MdiParent = objfrmPrincipal;
                            objfrm.Show();

                        }
                        else if (sTipoNFe.Equals("I"))
                        {
                            frmImportaEscritorNfe objfrm = new frmImportaEscritorNfe();
                            objfrm.MdiParent = objfrmPrincipal;
                            objfrm.Show();
                        }
                        this.Close();
                    }                    
                }
                else
                {
                    KryptonMessageBox.Show(null, "Não existem arquivos na pasta de Config.", "A V I S O", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception ex)
            {
                KryptonMessageBox.Show(null, "Ocorreu uma Exceção não tratada, Informe a Mensagem abaixo ao suporte HLP."
                    + Environment.NewLine
                    + ex.Message, "E R R O", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }
        }