Exemple #1
0
        private void CarregarDadosUsuario()
        {
            int          IdInstrutor = Convert.ToInt32(txtIdUsuario.Text);
            InstrutorDAL iDAL        = new InstrutorDAL();
            Instrutor    i           = iDAL.PesquisarPorCodigo(IdInstrutor);

            if (i != null)
            {
                txtNomeInstrutor.Text  = i.NomeInstrutor;
                txtEmailInstrutor.Text = i.EmailInstrutor;
                txtLogin.Text          = i.Login;
            }
        }
Exemple #2
0
        protected void CadastrarInstrutor(object sender, EventArgs e)
        {
            Instrutor i = new Instrutor();

            i.NomeInstrutor  = txtNome.Text;
            i.Login          = txtUsuario.Text;
            i.EmailInstrutor = txtEmail.Text;
            i.Senha          = txtSenha.Text;

            InstrutorDAL iDAL = new InstrutorDAL();

            iDAL.Gravar(i);

            lblMensagem.Text = "Cadastro de " + i.NomeInstrutor + "  realizado com sucesso. Faça login agora mesmo.";
            txtNome.Text     = string.Empty;
            txtUsuario.Text  = string.Empty;
            txtEmail.Text    = string.Empty;
            txtSenha.Text    = string.Empty;
        }
Exemple #3
0
        protected void btnAlterarInstrutor(object sender, EventArgs e)
        {
            try
            {
                Instrutor i = new Instrutor();
                i.IdInstrutor    = Convert.ToInt32(txtIdUsuario.Text);
                i.NomeInstrutor  = Convert.ToString(txtNomeInstrutor.Text);
                i.EmailInstrutor = Convert.ToString(txtEmailInstrutor.Text);
                i.Login          = Convert.ToString(txtLogin.Text);

                InstrutorDAL iDAL = new InstrutorDAL();
                iDAL.Atualizar(i);
                lblMensagem.Text = "Usuário " + i.Login + " atualizado com sucesso.";
            }
            catch (Exception)
            {
                throw;
            }
        }