Last active
October 3, 2019 18:38
-
-
Save MirandinhaKL/b6e1ce1b31e68b5ebcd58abf065e4a14 to your computer and use it in GitHub Desktop.
Mensagens
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
/// <summary> | |
/// Provides differente methods for displaying error messages to user. | |
/// </summary> | |
internal class MensagemDeErro | |
{ | |
/// <summary> | |
/// Displays the errors message returned by the database. | |
/// </summary> | |
/// <param name="resultado_conexao"></param> | |
public void informaErroBancoDados(string resultadoConexao) | |
{ | |
if (resultadoConexao != "1") | |
{ | |
MessageBox.Show(resultadoConexao, "Status da ação", | |
MessageBoxButtons.OK, MessageBoxIcon.Error); | |
} | |
} | |
/// <summary> | |
/// Displays a message about an action performed by the user. | |
/// </summary> | |
/// <param name="resultado_conexao"></param> | |
/// <param name="mensagem">Which action was performed successfully.</param> | |
/// | |
public void informaMensagemSobreOperacao(string resultadoConexao, string mensagem) | |
{ | |
if (resultadoConexao != "1") | |
{ | |
MessageBox.Show(resultadoConexao, "Status da ação", | |
MessageBoxButtons.OK, MessageBoxIcon.Error); | |
} | |
else | |
{ | |
MessageBox.Show(mensagem, "Staus da ação", | |
MessageBoxButtons.OK, MessageBoxIcon.Information); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Limpa dados de todos os postos. | |
/// </summary> | |
/// <param name="sender"></param> | |
/// <param name="e"></param> | |
private void Btn_limpa_todos_postos_Click(object sender, EventArgs e) | |
{ | |
string mensagem = "Todos os dados serão apagados e esta ação não poderá ser desfeita. " + | |
"Deseja continuar?"; | |
string titulo = "Status da ação"; | |
MessageBoxButtons botoes = MessageBoxButtons.YesNo; | |
MessageBoxIcon icone = MessageBoxIcon.Exclamation; | |
DialogResult resultado = MessageBox.Show(mensagem, titulo, botoes, icone); | |
if (resultado == DialogResult.Yes) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment