private void btVoltar_Click(object sender, EventArgs e) { TelaInicial telaEstoque = new TelaInicial(); this.Hide(); telaEstoque.ShowDialog(); }
private void btVoltar_Click(object sender, EventArgs e) { TelaInicial ti = new TelaInicial(); this.Hide(); ti.Show(); }
private void BuscaPet_FormClosed(object sender, FormClosedEventArgs e) { TelaInicial fromInicialScreen = new TelaInicial(); this.Dispose(); fromInicialScreen.ShowDialog(); }
public override void Editar() { try { Produto produtoSelecionado = _controlProduto.ObtemProdutoSelecionado(); TelaInicial form = new TelaInicial(_produtoService); form.EditarProduto = produtoSelecionado; DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { _produtoService.Atualizar(form.EditarProduto); } IEnumerable <Produto> produtos = _produtoService.BuscarTodos(); _controlProduto.PopularListagemProdutos(produtos); } catch (NullReferenceException) { throw new Exception("Selecione um Produto!"); } catch (Exception ex) { throw new Exception(ex.Message); } }
private void buttonCadastrarPet_Click(object sender, EventArgs e) { try { MySqlConnection connectbd = new MySqlConnection(); MySqlCommand comandoMysql; MySqlDataReader reader; connectbd.ConnectionString = "server=localhost;" + "database= bd_petfamily; " + "user id=root; Password="******"Por favor, insira ao menos o Nome do Pet, Responsável, Classificação e o Sexo.", "Erro ao cadastrar Pet", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { string cadastrarCliente = "insert into Pets (nome_pet, id_cliente, id_classificacao, id_porte, sexo, descricao) value (" + "'" + txtBoxNomePet.Text + "', " + "'" + idResponsavel + "', " + "'" + idClassificacao + "', " + "'" + idPorte + "', " + "'" + txtBoxSexo.Text + "', " + "'" + txtBoxDescricao.Text + "')"; comandoMysql = new MySqlCommand(cadastrarCliente, connectbd); reader = comandoMysql.ExecuteReader(); MessageBox.Show("Pet " + txtBoxNomePet.Text + " cadastrado com sucesso!"); txtBoxNomePet.Clear(); cmbBoxResponsavel.Text = ""; cmbBoxClassificacao.Text = ""; cmbBoxPorte.Text = ""; txtBoxSexo.Clear(); txtBoxDescricao.Clear(); TelaInicial fromInicialScreen = new TelaInicial(); this.Dispose(); fromInicialScreen.ShowDialog(); } connectbd.Close(); } catch (MySqlException x) { MessageBox.Show(x.Message); } }
private void button4_Click(object sender, EventArgs e) { TelaInicial tl_ini = new TelaInicial(); tl_ini._nomeBD = banco_de_dados; tl_ini.Show(); this.Hide(); }
private void buttonCancelarCadastroCliente_Click(object sender, EventArgs e) { if (MessageBox.Show("Deseja mesmo sair?", "Atenção!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { TelaInicial fromInicialScreen = new TelaInicial(); this.Dispose(); fromInicialScreen.ShowDialog(); } }
private void CRUDCliente_FormClosed(object sender, FormClosedEventArgs e) { if (MessageBox.Show("Deseja mesmo sair?", "Atenção!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { TelaInicial fromInicialScreen = new TelaInicial(); this.Dispose(); fromInicialScreen.ShowDialog(); } }
private void buttonAtualizarUsuario_Click(object sender, EventArgs e) { if (TelaLogin.LoginAcess == 1) { try { MySqlConnection connectbd = new MySqlConnection(); MySqlCommand comandoMysql; MySqlDataReader reader; connectbd.ConnectionString = "server=localhost;" + "database= bd_petfamily; " + "user id=root; Password="******"Preencha todos os campos para atualizar o Usuário.", "Erro ao atualizar Usuário", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { string alterarUsuariot = "update LoginSistema set " + "usuario = '" + txtBoxNomeUsuario.Text + "', " + "senha = '" + txtBoxSenhaUsuario.Text + "', " + "palavra_chave = '" + txtBoxPalavraChave.Text + "' " + "where id_login = '******'"; comandoMysql = new MySqlCommand(alterarUsuariot, connectbd); reader = comandoMysql.ExecuteReader(); MessageBox.Show("Dados atualizados com sucesso!"); TelaInicial fromInicialScreen = new TelaInicial(); this.Dispose(); fromInicialScreen.ShowDialog(); } connectbd.Close(); } catch (MySqlException x) { MessageBox.Show(x.Message); } } else { MessageBox.Show("Somente o administrador pode visualizar a senha de outros usuários.", "Acesso negado", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void dg_banco_de_dados_presentes_DoubleClick(object sender, EventArgs e) { Infos.ConectionString = "Persist Security Info=False;server=" + tb_servidor.Text + ";Port=" + tb_porta.Text + ";database=" + dg_banco_de_dados_presentes.CurrentCell.Value.ToString() + ";uid=" + tb_usuario.Text + ";pwd=" + tb_senha.Text + ""; TelaInicial tl_ini = new TelaInicial(); tl_ini._nomeBD = dg_banco_de_dados_presentes.CurrentCell.Value.ToString(); tl_ini.Show(); this.Close(); }
private async void Button_Click(object sender, RoutedEventArgs e) { if (!string.IsNullOrEmpty(PluginID_txt.Text)) { if (!plugins.Contains(PluginID_txt.Text)) { if (await new Utils().VerificarExisteAsync(PluginID_txt.Text, "PluginList", "ID")) { //criando Chip dinamicamente PluginInfo p = new PluginInfo(); _ = await p.InformacoesAsync(false, PluginID_txt.Text); StackPanel st = new StackPanel { Orientation = Orientation.Vertical }; foreach (string item in p.TooltipInfo) { _ = st.Children.Add(new TextBlock() { Text = item }); } Chip newChip = new Chip { Cursor = Cursors.Arrow, Content = PluginID_txt.Text, ToolTip = st, IsDeletable = true, DeleteToolTip = "Remover", Margin = new Thickness(2) }; //setando tempo que o tooltip ficará visivel! ToolTipService.SetShowDuration(newChip, 100000); //gerando metodo do botao de remover o chip newChip.DeleteClick += NewChip_DeleteClick; //adicionando o chip no WrapPanel _ = ListChips_wp.Children.Add(newChip); //adicionando ID do plugin em uma List<> para poder saber quais plugins ja foram adicionados! plugins.Add(PluginID_txt.Text); //variavel contadora de plugins adicionados byte i = 1; if (ContarPluginAdd_bg.Badge != null) { i = Convert.ToByte(ContarPluginAdd_bg.Badge); i++; } ContarPluginAdd_bg.Badge = i; PluginID_txt.Clear(); } else { TelaInicial.EnviarMensagemDialogHostAsync("Plugin informado nao existe!"); } } else { TelaInicial.EnviarMensagemDialogHostAsync("Este plugin ja foi adicionado na lista!"); } } }
public override void Adicionar() { TelaInicial form = new TelaInicial(_produtoService); DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { _produtoService.Adicionar(form.NovoProduto); IEnumerable <Produto> produtos = _produtoService.BuscarTodos(); _controlProduto.PopularListagemProdutos(produtos); } }
public override void Adicionar() { TelaInicial form = new TelaInicial(_service); DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { _service.Adicionar(form.NovoClienteFisico); IEnumerable <ClienteFisico> clientesFisicos = _service.BuscarTodos(); //_controlSerie.PopularListagemSeries(series); } }
private void buttonAlterarCliente_Click(object sender, EventArgs e) { try { MySqlConnection connectbd = new MySqlConnection(); MySqlCommand comandoMysql; MySqlDataReader reader; connectbd.ConnectionString = "server=localhost;" + "database= bd_petfamily; " + "user id=root; Password="******"Insira ao menos um Nome e um Fone (Fone1).", "Erro ao cadastrar Cliente", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { string alterarCliente = "update Clientes set " + "nome = '" + txtBoxNome.Text + "', " + "cpf = '" + txtBoxCPF.Text + "', " + "rg = '" + txtBoxRG.Text + "', " + "fone1 = '" + txtBoxFone1.Text + "', " + "fone2 = '" + txtBoxFone2.Text + "', " + "endereco = '" + txtBoxEndereco.Text + "', " + "numero = '" + txtBoxNumero.Text + "', " + "bairro = '" + txtBoxBairro.Text + "', " + "cidade = '" + txtBoxCidade.Text + "'" + "where id_cliente = '" + BuscaCliente.cliente_id + "'"; comandoMysql = new MySqlCommand(alterarCliente, connectbd); reader = comandoMysql.ExecuteReader(); MessageBox.Show("Dados atualizados com sucesso!"); TelaInicial fromInicialScreen = new TelaInicial(); this.Dispose(); fromInicialScreen.ShowDialog(); } connectbd.Close(); } catch (MySqlException x) { MessageBox.Show(x.Message); } }
public TelaInicialViewModel(TelaInicial ti) { telaInicial = ti; flag = true; MensagemAtualizacaoUm = ""; MensagemAtualizacaoDois = ""; //site antigo: http://espacopresenca.com.br/?page_id=2986 new VerificadorDeVersao(this).GetCurrentVersion("https://espacopresenca.com.br/a-atualizacoes"); //site antigo: http://espacopresenca.com.br/?page_id=2988 new UserMessageManager(this).GetUserMessage("http://espacopresenca.com.br/a-comunicacoes"); conexao = DependencyService.Get <ISqlite>().GetConnection(); }
private void buttonAlterarPet_Click(object sender, EventArgs e) { try { MySqlConnection connectbd = new MySqlConnection(); MySqlCommand comandoMysql; MySqlDataReader reader; connectbd.ConnectionString = "server=localhost;" + "database= bd_petfamily; " + "user id=root; Password="******"Por favor, insira ao menos o Nome do Pet, Responsável, Classificação e o Sexo.", "Erro ao atualizar Pet", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { string alterarPet = "update Pets set " + "nome_pet = '" + txtBoxNomePet.Text + "', " + "id_cliente = '" + idResponsavel + "', " + "id_classificacao = '" + idClassificacao + "', " + "id_porte = '" + idPorte + "', " + "sexo = '" + txtBoxSexo.Text + "', " + "descricao = '" + txtBoxDescricao.Text + "' " + "where id_pet = '" + BuscaPet.pet_id + "'"; comandoMysql = new MySqlCommand(alterarPet, connectbd); reader = comandoMysql.ExecuteReader(); MessageBox.Show("Dados atualizados com sucesso!"); TelaInicial fromInicialScreen = new TelaInicial(); this.Dispose(); fromInicialScreen.ShowDialog(); } connectbd.Close(); } catch (MySqlException x) { MessageBox.Show("Se você ver esta tela selecione novamente o Responsável, a Classificação e o Porte para realizar as alterações no Pet", "Atenção!", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Mostra as informaçoes da exception disparada. /// </summary> /// <param name="e">A exception</param> public static void MostrarExceptions(Exception e) { //Tipo: qual exception que foi disparada, lembrando que 'FullName' pega a namespace tbm //Erro: mostra a mensagem do erro //Informaçoes: mostra as informaçoes gerais do erro //Metodo: deveria mostrar o metodo onde a exceçao foi disparada, mas eu to com preguiça de estudar esse troço ai //Linha: troço dificil do cao, passei horas tentando achar um jeito, e nao deu muito certo '-' string MensagemErro = $"Tipo: {e.GetType().FullName}\n\nErro: {e.Message}\n\nInformaçoes: {e.StackTrace}"; /*\n\nMetodo: {e.StackTrace}\n\nLinha: {new StackTrace().GetFrame(0).GetFileLineNumber()}*/ //enviando mensagem com o erro TelaInicial.EnviarMensagemDialogHostAsync(MensagemErro); }
private void buttonCadastrarCliente_Click(object sender, EventArgs e) { try { MySqlConnection connectbd = new MySqlConnection(); MySqlCommand comandoMysql; MySqlDataReader reader; connectbd.ConnectionString = "server=localhost;" + "database= bd_petfamily; " + "user id=root; Password="******"Insira ao menos um Nome e um Fone (Fone1).", "Erro ao cadastrar Cliente", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { string cadastrarCliente = "insert into Clientes (nome, cpf, rg, fone1, fone2, endereco, numero, bairro, cidade) value (" + "'" + txtBoxNome.Text + "', " + "'" + txtBoxCPF.Text + "', " + "'" + txtBoxRG.Text + "', " + "'" + txtBoxFone1.Text + "', " + "'" + txtBoxFone2.Text + "', " + "'" + txtBoxEndereco.Text + "', " + "'" + txtBoxNumero.Text + "', " + "'" + txtBoxBairro.Text + "', " + "'" + txtBoxCidade.Text + "')"; comandoMysql = new MySqlCommand(cadastrarCliente, connectbd); reader = comandoMysql.ExecuteReader(); MessageBox.Show("Cliente " + txtBoxNome.Text + " cadastrado com sucesso!"); TelaInicial fromInicialScreen = new TelaInicial(); this.Dispose(); fromInicialScreen.ShowDialog(); } connectbd.Close(); } catch (MySqlException x) { MessageBox.Show(x.Message); } }
private void buttonCadastrarUsuario_Click(object sender, EventArgs e) { try { MySqlConnection connectbd = new MySqlConnection(); MySqlCommand comandoMysql; MySqlDataReader reader; connectbd.ConnectionString = "server=localhost;" + "database= bd_petfamily; " + "user id=root; Password="******"Preencha todos os campos para cadastrar o Usuário.", "Erro ao cadastrar Usuário", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { string cadastrarCliente = "insert into LoginSistema (usuario, senha, palavra_chave) value (" + "'" + txtBoxNomeUsuario.Text + "', " + "'" + txtBoxSenhaUsuario.Text + "', " + "'" + txtBoxPalavraChave.Text + "')"; comandoMysql = new MySqlCommand(cadastrarCliente, connectbd); reader = comandoMysql.ExecuteReader(); MessageBox.Show("Usuário " + txtBoxNomeUsuario.Text + " cadastrado com sucesso!"); txtBoxNomeUsuario.Clear(); txtBoxSenhaUsuario.Clear(); txtBoxPalavraChave.Clear(); TelaInicial fromInicialScreen = new TelaInicial(); this.Dispose(); fromInicialScreen.ShowDialog(); } connectbd.Close(); } catch (MySqlException x) { MessageBox.Show(x.Message); } }
private void btnCadastrar_Click(object sender, RoutedEventArgs e) { FuncionarioBean bean = new FuncionarioBean(); bean.Nome = txtNome.Text; bean.Re = txtRE.Text; bean.Senha = Encriptografar.Encripto(pswSenha.Password); bean.Permissao = permissao; FuncionarioDAO.CadastrarFuncionario(bean); this.Close(); TelaInicial telaInicial = new TelaInicial(); telaInicial.Show(); }
private async void Card_MouseDown(object sender, MouseButtonEventArgs e) { //pegando a key da licenda dentro header do expander. string lic = (((((Card)sender).Content as Expander).Header as StackPanel).Children[1] as TextBlock).Text; //fazendo uma verificaçao antes de exluir a licença if (await TelaInicial.EscolhaDialogHostAsync($"Realmente quer excluir essa licença?\n{lic}")) { //excluindo a licença do banco, e verificando o retorno da tarefa if (await new LicencaInfo().ApagarAsync(lic)) { //removendo o card da tela ListaLicencas_sp.Children.Remove((Card)sender); //enviando a mensagem de sucesso!. MetodosConstantes.EnviarMenssagem($"{lic} foi removida!"); } } }
/// <summary> /// Cria as tabelas no banco de dados caso elas nao existam. (PluginList e LicenceList). /// </summary> /// <returns>Retorna a conclusao da tarefa</returns> public async Task CriarAsync() { using (MySqlConnection con = new MySqlConnection(await PegarConexaoMySQL.ConexaoAsync())) { try { await con.OpenAsync(); using (MySqlCommand createTable = new MySqlCommand(query, con)) { _ = await createTable.ExecuteNonQueryAsync(); } } catch (Exception) { TelaInicial.EnviarMensagemDialogHostAsync("Nao foi possível gerar a tabela no mysql\nSe for sua primeira inicializaçao, por favor, insira as credenciais na configuraçao\ne selecione o tipo de banco 'Local/Externo'\n\nDepois reinicie o software!"); } } }
private async void Button_Click(object sender, RoutedEventArgs e) { if (await TelaInicial.EscolhaDialogHostAsync("Voce tem certeza que deseja limpar todos os campos?")) { _caminhoImagem = null; ImagemPlugin_img.Source = null; ExcluirArquivo_bt.IsEnabled = false; ProcurarArquivo_bt.IsEnabled = true; CaminhoArquivo_txt.Clear(); NomeDoPlugin_txt.Clear(); VersaoDoPlugin_txt.Clear(); TipoDoPlugin_gb.SelectedIndex = -1; PrecoDoPlugin_txt.Clear(); PrecoDoPlugin_txt.IsEnabled = false; AutorDoPlugin_txt.Clear(); DescricaoDoPlugin_txt.Clear(); MetodosConstantes.EnviarMenssagem("Os campos foram limpos!"); } }
private void Entrar_MouseDown(object sender, MouseButtonEventArgs e) { var sup = cbb_Usuario.SelectedItem.ToString(); var senha = "1234"; if (String.Equals(sup, "System.Windows.Controls.ComboBoxItem: SUPERVISOR")) { if (txb_Senha.Password.Equals(senha)) { TelaInicial tela = new TelaInicial(); tela.Show(); Close(); } else { MessageBox.Show("Senha Incorreta", "Atenção"); } } }
private void btnEntrar_Click(object sender, EventArgs e) { //IServicoRepositorio _servicoRepositorio; //string usuario = "admin"; //string senha = "123"; //if (txtUsuario.Text == usuario && txtSenha.Text == senha) //{ ServicoService _service; _service = new ServicoService(null); TelaInicial inicial = new TelaInicial(_service); inicial.Show(); this.Hide(); //} //else //{ // MessageBox.Show("Login Incorreto!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); //} }
public void RealizaLogin(string username, string password, string senhaRepetida) { tB_USUARIO.nm_nome_usuario = username; tB_USUARIO.ds_senha = password; try { using (db_peixesEntities DB = new db_peixesEntities()) { if (username != String.Empty || password != String.Empty || senhaRepetida != String.Empty) { if (password == senhaRepetida) { // Retorna true or false caso dado exita ou nao var result = DB.TB_USUARIO.Any(x => x.nm_nome_usuario == username && x.ds_senha == password); if (result == true) { TelaInicial tela1 = new TelaInicial(username); tela1.Show(); } else { MessageBox.Show($"Usuario {username} não existe, se cadastre", "Usuario não existe", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("As senhas não são iguais", "Senhas diferentes", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Alguns Campos estão vazios", "Campos Vazios", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void CarregaComponentes() //percorre todos os componentes, setando as telas caso encontre { foreach (GameComponent gc in Game.Components) { if (gc is TelaInicial) { telaInicial = (TelaInicial)gc; } else if (gc is TelaJogo) { telaJogo = (TelaJogo)gc; } else if (gc is TelaEnredo) { telaEnredo = (TelaEnredo)gc; } else if (gc is TelaPause) { telaPause = (TelaPause)gc; } } }
private void realizarLogin() { string loginInserido = this.metroTextBoxUser.Text.ToLower(); string passwordInserido = this.metroTextBoxSenha.Text; LoginController loginController = new LoginController(); loginController.verificaUsuarioSenha(loginInserido, passwordInserido); if (Globals.tipoDeUsuario.Equals("user-comum") || Globals.tipoDeUsuario.Equals("administrador-comum") || Globals.tipoDeUsuario.Equals("administrador-geral")) { TelaInicial telaInicial = new TelaInicial(); telaInicial.Show(); this.Hide(); } else { MessageBox.Show("Senha ou usuários incorretos, por favor, tente novamente.", "Login falhou", MessageBoxButtons.OK, MessageBoxIcon.Information); this.metroTextBoxUser.Text = ""; this.metroTextBoxSenha.Text = ""; this.ActiveControl = this.metroTextBoxUser; } }
private void button1_Click(object sender, EventArgs e) { FuncionarioModel funcionario = new FuncionarioModel(); funcionario.Login = lb_login.Text.ToString(); funcionario.Senha = lb_senha.Text.ToString(); UsuarioController usuario = new UsuarioController(); if (usuario.verificaUsuarioBanco(funcionario.Login, funcionario.Senha)) { funcionario = usuario.usuarioLogado(funcionario.Login, funcionario.Senha); MessageBox.Show("Efetuado logon com sucesso"); TelaInicial telainicial = new TelaInicial(funcionario.Nome); this.Hide(); telainicial.Show(); } else { MessageBox.Show("Não foi possivel efetuar o logon. Verifique o login e a senha."); } }
private async Task VerificarEAdicionarAsync() { if (string.IsNullOrEmpty(LicencaGerada_txt.Text)) { TelaInicial.EnviarMensagemDialogHostAsync("Voce precisa gerar uma licença primeiro!"); return; } if (string.IsNullOrEmpty(ServidorIP_txt.Text)) { TelaInicial.EnviarMensagemDialogHostAsync("Voce precisa informar o ip do servidor!"); return; } bool keyGlobal = LicencaGlobal_tb.IsChecked == true; if (VerificarCodigoValido(CodigoPlugin_txt.Text) || keyGlobal) { if (!await LicencaExisteAsync()) { if (await CodigoExisteOuLicencaIsGlobal(keyGlobal)) { await GerarIDAndAdicionarLicencaAsync(keyGlobal, keyGlobal? 0 : PluginIDValue()); } else { TelaInicial.EnviarMensagemDialogHostAsync("ERRO: Plugin informado nao existe!"); } } else { TelaInicial.EnviarMensagemDialogHostAsync("ERRO: Está licença ja existe\nClique no botao para gerar outra licença!"); } } else { TelaInicial.EnviarMensagemDialogHostAsync("Codigo do plugin informado é inválido!"); } }