private void frmMenu_Load(object sender, EventArgs e) { try { VerificaQuantidadesDeDatas(); AtribuirItensNoRodape(_usuario); lblUsuarioLogado.Text = _usuario.NomeCompleto; InstanciarTipoCadastroRepositorio(); InstanciarTipoPagamentoRepositorio(); _tipoCadastroRepositorio.Cadastrar(); _tipoPagamentoRepositorio.Cadastrar(); CarregarTextoDePermissao(); if (InserirDatasUnicas() > 0) { _caixaRepositorio = new CaixaRepositorio(); if (_caixaRepositorio.GetValor().Valor > 0) { Properties.Settings.Default.CaixaAberto = true; } else { Properties.Settings.Default.CaixaAberto = false; } } if (_keyGenRepositorio.GetDiasTrail() == 0) { new frmKeyGen().Show(); this.Hide(); } } catch (CustomException erro) { DialogMessage.MessageFullComButtonOkIconeDeInformacao(erro.Message, "Aviso"); } catch (Exception erro) { DialogMessage.MessageComButtonOkIconeErro(erro.Message, "Erro"); } }
private void frmMenu_Load(object sender, EventArgs e) { try { this.KeyPreview = true; ContainerContext.Context = this; OpenMdiForm.LoadNewKeepAnother(this, new frmAlertaEstoque()); VerificaQuantidadesDeDatas(); AtribuirItensNoRodape(_usuario); lblUsuarioLogado.Text = _usuario.NomeCompleto; InstanciarTipoCadastroRepositorio(); InstanciarTipoPagamentoRepositorio(); _tipoCadastroRepositorio.Cadastrar(); _tipoPagamentoRepositorio.Cadastrar(); CarregarTextoDePermissao(); if (InserirDatasUnicas() > 0) { Properties.Settings.Default.CaixaAberto = new CaixaRepositorio().GetValor().Valor > 0 ? true : false; } if (_keyGenRepositorio.GetDiasTrail() == 0) { new frmKeyGen().Show(); this.Hide(); } } catch (CustomException erro) { DialogMessage.MessageFullComButtonOkIconeDeInformacao(erro.Message, "Aviso"); } catch (Exception erro) { SaveErroInTxt.RecordInTxt(erro, this.GetType().Name); DialogMessage.MessageComButtonOkIconeErro(erro.Message, "Erro"); } }