private void BtnLimpar_Click(object sender, EventArgs e) { TxtPNome.Text = ""; TxtSNome.Text = ""; TxtEmail.Text = ""; TxtCargo.Text = ""; TxtSenha.Text = ""; TxtRSenha.Text = ""; TxtPNome.Focus(); }
private Boolean ValidarCampos() { if (TxtPNome.Text == "") { Error.SendError("O campo primeiro nome tem preenchimento obrigatório", "Campo vazio"); TxtPNome.Focus(); return(false); } else if (TxtSNome.Text == "") { Error.SendError("O campo sobrenome tem preenchimento obrigatório", "Campo vazio"); TxtSNome.Focus(); return(false); } else if (TxtUserName.Text == "") { Error.SendError("O campo nome de usuário tem preenchimento obrigatório", "Campo vazio"); TxtUserName.Focus(); return(false); } else if (TxtEmail.Text == "") { Error.SendError("O campo email tem preenchimento obrigatório", "Campo vazio"); TxtEmail.Focus(); return(false); } else if (TxtCargo.Text == "") { Error.SendError("O campo cargo tem preenchimento obrigatório", "Campo vazio"); TxtCargo.Focus(); return(false); } else if (TxtSenha.Text == "") { Error.SendError("O campo senha tem preenchimento obrigatório", "Campo vazio"); TxtSenha.Focus(); return(false); } else if (TxtRSenha.Text == "") { Error.SendError("O campo de repetição de senha tem preenchimento obrigatório", "Campo vazio"); TxtRSenha.Focus(); return(false); } else if (TxtSenha.Text != TxtRSenha.Text) { Error.SendError("As senhas devem ser iguais", "Senhas diferentes"); TxtSenha.Focus(); return(false); } else { return(true); } }
private void PreencherCampos(string _user_name) { var Usuario = Controller.GetPessoa(UserName); TxtPNome.Focus(); TxtPNome.Text = Usuario.p_nome; TxtSNome.Text = Usuario.s_nome; TxtCargo.Text = Usuario.cargo; TxtEmail.Text = Usuario.email; TxtSenha.Text = Usuario.senha; TxtRSenha.Text = Usuario.senha; IDUsuario = Usuario.pessoa; Admin = Usuario.admin; }