예제 #1
0
        public override void Selecionar()
        {
            ClsConexao conexao = new ClsConexao();

            conexao.conectar();
            SqlCommand cmd = new SqlCommand("sp_Vizualizar_Usuario", conexao.conexao);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@pId_Prontuario", mId_Prontuario);
            SqlDataReader dr        = cmd.ExecuteReader(CommandBehavior.SingleRow);
            ClsProfessor  professor = new ClsProfessor();

            professor.Id_Prontuario = mId_Prontuario;
            professor.Nm_Usuario    = dr["nm_usuario"].ToString();
            professor.St_Usuario    = Convert.ToInt32(dr["St_Usuario"].ToString());
            conexao.desconectar();
        }
예제 #2
0
파일: frmLogin.cs 프로젝트: DevBacega/TIND
        private void btnLogar_Click(object sender, EventArgs e)
        {
            ClsProfessor professor = new ClsProfessor()
            {
                Ds_Usuario = txtUsuario.Text,
                Ds_Senha   = txtSenha.Text
            };

            if (professor.Login() == true)
            {
                /*frmUsuario frm = new frmUsuario();
                 * this.Hide();
                 * frm.ShowDialog();*/
                frmMenu frm = new frmMenu();
                this.Hide();
                frm.ShowDialog();
            }
            else
            {
                MessageBox.Show("Usuário Inválido");
            }
        }