public frmGerarNumeroNfe(frmEnviaNfs objfrmNFes) { InitializeComponent(); this.Text = "Geração do Número de RPS"; grdNumeroUltNF.Text = "Número do último RPS"; grdNumeroASerEmi.Text = "Número do próximo RPS"; btnGerar.Text = "Gerar Número de RPS"; belStatic.bNotaServico = true; this.objfrmNFes = objfrmNFes; psEmp = (belStatic.bNotaServico == true ? belStatic.codEmpresaNFe : belStatic.codEmpresaNFe); }
private void nFeServiçoToolStripMenuItem_Click(object sender, EventArgs e) { if (belStatic.sNmCidadeEmpresa.ToUpper().Equals("ITU") || belStatic.sNmCidadeEmpresa.ToUpper().Equals("JUNDIAI")) { MinimizarTudo(); try { Boolean ok = false; foreach (Form frm in this.MdiChildren) { if (frm is frmEnviaNfs) { frm.BringToFront(); ok = true; } } if (ok == false) { frmEnviaNfs objfrm = new frmEnviaNfs(); objfrm.MdiParent = this; objfrm.WindowState = FormWindowState.Minimized; objfrm.Show(); objfrm.WindowState = FormWindowState.Maximized; } else { KryptonMessageBox.Show(null, "A Tela de Envio de Notas já se encontra aberta", "A V I S O", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { if (ex.Message.ToString() != "m_safeCertContext é um identificador inválido.") { KryptonMessageBox.Show(null, "Erro na configurações das pastas - " + ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); Boolean ok = false; foreach (Form frm in this.MdiChildren) { if (frm is frmLoginConfig) { frm.BringToFront(); ok = true; } } if (!ok) { frmLoginConfig objfrm = new frmLoginConfig(this); objfrm.MdiParent = this; objfrm.Show(); } } } } else { hlpMessageBox.ShowAviso("Módulo de Nota fiscal de serviço não liberado para a Cidade de " + belStatic.sNmCidadeEmpresa); } }
private void btnNfeServico_Click(object sender, EventArgs e) { try { Boolean ok = false; foreach (Form frm in this.MdiChildren) { if (frm is frmEnviaNfs) { frm.BringToFront(); ok = true; } } if (ok == false) { frmEnviaNfs objfrm = new frmEnviaNfs(); objfrm.MdiParent = this; objfrm.Show(); } else { KryptonMessageBox.Show(null, "A Tela de Envio de Notas já se encontra aberta", "A V I S O", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { if (ex.Message.ToString() != "m_safeCertContext é um identificador inválido.") { KryptonMessageBox.Show(null, "Erro na configurações das pastas - " + ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); Boolean ok = false; foreach (Form frm in this.MdiChildren) { if (frm is frmLoginConfig) { frm.BringToFront(); ok = true; } } if (!ok) { frmLoginConfig objfrm = new frmLoginConfig(this); objfrm.MdiParent = this; objfrm.Show(); } } } }
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(); } }