Пример #1
0
        static void Main(string[] args)
        {
            AlunoController aluno = new AlunoController();

            aluno.InformacaoAluno();
            aluno.Exibir();
        }
Пример #2
0
        public void recarregarData()
        {
            dataGridView1.Rows.Clear();
            List <Aluno> alunos = AlunoController.BuscarTodosalunos();

            for (int i = 0; i < alunos.Count; i++)
            {
                string situacao = "";
                if (alunos[i].Situacao == 1)
                {
                    situacao = "Ativo";
                }
                else
                {
                    situacao = "Inativo";
                }
                dataGridView1.Rows.Add(alunos[i].Nome, alunos[i].Cpf, "Aluno", situacao);
            }
            List <Professor> professores = ProfessorController.BuscarTodosprofessores();

            for (int i = 0; i < professores.Count; i++)
            {
                string situacao = "";
                if (professores[i].Situacao == 1)
                {
                    situacao = "Ativo";
                }
                else
                {
                    situacao = "Inativo";
                }
                dataGridView1.Rows.Add(professores[i].Nome, professores[i].Cpf, "Professor", situacao);
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            AlunoController aluno = new AlunoController();

            aluno.pegarInfoAluno();
            aluno.mostrarInfoAluno();
        }
Пример #4
0
        public void Atualizar()
        {
            // ================ CENTARIO ===================== //
            //pega uma turma
            AlunoController t      = new AlunoController();
            List <Aluno>    alunos = t.Listar(new Aluno());
            string          nome   = "João";
            Aluno           att    = new Aluno();

            att.Nome      = alunos[0].Nome;
            att.idAluno   = alunos[0].idAluno;
            att.idTurma   = alunos[0].idTurma;
            att.Matricula = alunos[0].Matricula;
            att.Foto      = alunos[0].Foto;

            // ================ AÇÃO ===================== //

            att.Nome = nome;
            t.Atualizar(att);


            Aluno consulta = t.ListarById(att)[0];

            // ================ VALIDAÇÃO ===================== //
            //verificacao
            Assert.IsTrue(consulta.Nome == nome);
            Assert.IsNotNull(consulta.Nome);
            Assert.AreEqual(att.idAluno, consulta.idAluno);
        }
        private void btnConsulta_Click(object sender, EventArgs e)
        {
            Aluno alunoConsulta = new Aluno();

            alunoConsulta.nomeAluno = tbxNome.Text;
            alunoConsulta.cpfAluno  = tbxCPF.Text;
            alunoConsulta.rgAluno   = tbxRG.Text;

            AlunoController alunoController = new AlunoController();

            Aluno novoAluno = new Aluno();

            if (alunoConsulta.cpfAluno != "")
            {
                novoAluno = alunoController.Consulta(alunoConsulta);
                if (novoAluno == null)
                {
                    MessageBox.Show("Esse Registro não existe!");
                }
                else
                {
                    tbxNome.Text = novoAluno.nomeAluno;
                    tbxRG.Text   = novoAluno.rgAluno;
                    tbxCPF.Text  = novoAluno.cpfAluno;
                }
            }
            else
            {
                MessageBox.Show("Por Favor preencha o CPF para executar uma pesquisa!");
            }
        }
Пример #6
0
        static void Main(string[] args)
        {
            NhibernateHelper.Configurar();
            AlunoController alunoController = new AlunoController();

            alunoController.Cadastrar();
        }
Пример #7
0
        static void Main(string[] args)
        {
            AlunoController aluno1 = new AlunoController();

            aluno1.CadastrarAluno();
            aluno1.ExibirAluno();
        }
Пример #8
0
        static void Main(string[] args)
        {
            // Declarando Objeto
            AlunoController aluno = new AlunoController(); // Instaciando Objeto

            // Limpa a tela
            Console.Clear();

            // Cadastra o aluno no sistema
            aluno.CadastrarAluno();

            // Exibe o aluno
            aluno.ExibirAluno();

            // Exibe o aluno através do override do metodo ToString
            System.Console.WriteLine(aluno);


            // #region Cadastrando o segundo aluno
            //      // Declarando Objeto
            //     AlunoModel aluno2 = new AlunoModel(); // Instacioando Objeto

            //     // Cadastra o aluno no sistema
            //     aluno2.CadastrarAluno();

            //     // Exibe o aluno
            //     aluno2.ExibirAluno();
            // #endregion
        }
Пример #9
0
 private void OnMouseDown()
 {
     if (alState == AlunoStates.CHEATING)
     {
         slingshot.Clicked();
         clicked = this;
     }
 }
        public void Cadastrar_Get()
        {
            AlunoController controller = new AlunoController();
            var             result     = (ViewResult)controller.Cadastrar("teste");

            Assert.IsNotNull(result);
            Assert.AreEqual("", result.ViewName);
        }
Пример #11
0
 private void OnMouseUp()
 {
     if (alState == AlunoStates.CHEATING)
     {
         slingshot.Released();
         clicked = null;
     }
 }
Пример #12
0
        static void Main(string[] args)
        {
            AlunoController objAluno = new AlunoController();

            Console.Clear();
            objAluno.InsereDados();
            objAluno.ImprimeDados();
        }
Пример #13
0
        public void Carregar()
        {
            List <Aluno> alunos = new AlunoController().Listar(new Aluno());

            listaGridAlunos.DataSource = alunos;

            listaGridAlunos.DataBind();
        }
Пример #14
0
        static void Main(string[] args)
        {
            AlunoController aluno1 = new AlunoController();

            aluno1.CadastrarAluno();
            System.Console.WriteLine();
            aluno1.ExibirAluno();
        }
Пример #15
0
        //chamada de orientação
        private void BuscarAluno(AlunoModel alunoModel)
        {
            alunoModel.Nome = txbBusca.text.Trim();

            AlunoController alunoController = new AlunoController();

            dgvAlunos.DataSource = alunoController.PesquisarNome(alunoModel);
        }
Пример #16
0
        static void Main(string[] args)
        {
            AlunoController aluno = new AlunoController();

            aluno.Cadastrar();
            Console.Clear();
            aluno.Ler();
        }
Пример #17
0
        static void Main(string[] args)
        {
            AlunoController aluno = new AlunoController();

            aluno.LerAluno();

            aluno.ExibirAluno();
        }
Пример #18
0
        static void Main(string[] args)
        {
            AlunoController aluno1 = new AlunoController(); //instanciar

            Console.Clear();
            aluno1.CadastrarAluno();     //Comentar para auto preencher
            System.Console.WriteLine("---------------------");
            aluno1.ExibirAluno();
        }
Пример #19
0
        static void Main(string[] args)
        {
            AlunoController aluno = new AlunoController();

            Console.Clear();

            aluno.DadosAluno();

            aluno.ExibirDados();
        }
Пример #20
0
 private void OnTriggerExit2D(Collider2D collider)
 {
     if (collider.gameObject.CompareTag("Aluno") &&
         alunoParent.transform != collider.transform)
     {
         AlunoController aluno = collider.GetComponent <AlunoController>();
         aluno.SetOutline(false);
         alunoSelected = false;
     }
 }
Пример #21
0
        private void ListarAlunos()
        {
            //chamando controlador e listando no data grid view
            AlunoController alunoController = new AlunoController();

            dgvAlunos.DataSource = alunoController.Listar();

            //definindo tamanho da coluna de acordo com o conteúdo
            dgvAlunos.AutoResizeColumns();
        }
Пример #22
0
    public bool CanThrow()
    {
        // position(i==x, j==y), linha e coluna
        //direction(x, y), direção horizontal ou vertical
        //coluna move com x
        //linha move com y
        bool canThrow = false;
        bool cima     = direction.y == 1;
        bool baixo    = direction.y == -1;
        bool esquerda = direction.x == -1;
        bool direita  = direction.x == 1;

        if (shooter.position.x == 0)
        {
            //Debug.Log("Sou de baixo, pode ir pra cima");
            canThrow |= cima;
        }
        else
        {
            //Debug.Log("Nao sou de baixo, pode ir pra baixo");
            canThrow |= baixo;
            if (shooter.position.x != 3)
            {
                //Debug.Log("Nao sou de cima, pode ir pra cima");
                canThrow |= cima;
            }
        }

        if (shooter.position.y == 0)
        {
            //Debug.Log("Sou de esquerda, pode ir pra direita");
            canThrow |= direita;
        }
        else
        {
            //Debug.Log("Nao sou de esquerda, pode ir pra esquerda");
            canThrow |= esquerda;
            if (shooter.position.y != 4)
            {
                //Debug.Log("Nao sou de direita, pode ir pra direita");
                canThrow |= direita;
            }
        }

        if (canThrow)
        {
            AlunoController receiver = AlunoController.GetAluno(new Vector2Int((int)(shooter.position.x + direction.y),
                                                                               (int)(shooter.position.y + direction.x)));
            if (receiver.busted)
            {
                canThrow = false;
            }
        }
        return(canThrow);
    }
Пример #23
0
        public void RecarregarData()
        {
            dataGridView1.Rows.Clear();
            dataGridView1.ReadOnly = true;
            List <Aluno> alunos = AlunoController.BuscarAlunos();

            for (int i = 0; i < alunos.Count; i++)
            {
                dataGridView1.Rows.Add(alunos[i].Nome, alunos[i].Idade, alunos[i].Cpf);
            }
        }
Пример #24
0
 private void buttonAcao_Click(object sender, EventArgs e)
 {
     if (acaoUser.Equals(AcaoEnum.Acao.Cadastrar))
     {
         if (validaCampos())
         {
             // Valida o cpf
             if (Validadores.validarCPF(txtCPF.Text))
             {
                 Aluno aluno = new Aluno();
                 aluno.nome = txtNome.Text.Trim();
                 aluno.cpf  = txtCPF.Text;
                 AlunoController.adicionar(aluno);
                 MessageBox.Show("Aluno cadastrado com sucesso!");
                 this.Close();
             }
             else
             {
                 MessageBox.Show("CPF inválido!");
             }
         }
         else
         {
             MessageBox.Show("Nenhum campo pode ser vazio!");
         }
     }
     else if (acaoUser.Equals(AcaoEnum.Acao.Editar))
     {
         if (validaCampos())
         {
             // Valida o cpf
             if (Validadores.validarCPF(txtCPF.Text))
             {
                 alunoController.editar(idUser.Value, txtNome.Text.Trim(), txtCPF.Text.Trim());
                 MessageBox.Show("Aluno alterado com sucesso");
                 this.Close();
             }
             else
             {
                 MessageBox.Show("CPF inválido!");
             }
         }
         else
         {
             MessageBox.Show("Nenhum campo pode ser vazio!");
         }
     }
     else if (acaoUser.Equals(AcaoEnum.Acao.Excluir))
     {
         alunoController.remover(idUser.Value);
         MessageBox.Show("Aluno excluido com sucesso!");
         this.Close();
     }
 }
Пример #25
0
 private void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.gameObject.CompareTag("Aluno") &&
         alunoParent.transform != collider.transform)
     {
         AlunoController aluno = collider.GetComponent <AlunoController>();
         aluno.SetOutline(true);
         alunoSelected = true;
         alunoPosition.Set((int)aluno.position.x, (int)aluno.position.y);
     }
 }
Пример #26
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (AlunoController.RetornarAluno(textBox1.Text))
     {
         MessageBox.Show("Aluno cadastrado!");
         textBox1.Clear();
     }
     else
     {
         MessageBox.Show("Aluno não cadastrado!");
     }
 }
Пример #27
0
 private void botaoExcluir_Click(object sender, EventArgs e)
 {
     if (listaAlunos.SelectedItems.Count > 0)
     {
         ListViewItem    aluno_excluir = listaAlunos.SelectedItems[0];
         int             id_aluno      = int.Parse(aluno_excluir.Text);
         AlunoController controller    = new AlunoController();
         controller.excluir(id_aluno);
         this.ListarAlunos();
     }
     this.VisibilityBotaoAcao();
 }
Пример #28
0
 void Start()
 {
     Screen.orientation = ScreenOrientation.Landscape;
     //timerPanel.GetComponent<Canvas>().renderMode = RenderMode.WorldSpace;
     AlunoController.SpawnAlunos();
     aSource  = GetComponent <AudioSource>();
     Instance = this;
     ganhouUI.SetActive(false);
     perdeuUI.SetActive(false);
     timerPanel.SetActive(false);
     UnityEngine.Debug.Log("Alunos para acabar: " + (20 - contadorDeDedoDuro));
     UnityEngine.Debug.Log("Alunos dedo duros: " + contadorDeDedoDuro);
 }
Пример #29
0
        static void Main(string[] args)
        {
            Console.WriteLine("**SISTEMA DE CONTROLE E CADASTRO DE ALUNO**");

            var alunoController = new AlunoController();

            Console.WriteLine("(1) CADASTRAR ALUNO");
            Console.WriteLine("(2) CONSULTAR ALUNOS");
            Console.WriteLine("(3) ATUALIZAR ALUNO");
            Console.WriteLine("(4) EXCLUIR ALUNO");
            Console.WriteLine("(0) SAIR DO SISTEMA");
            Console.WriteLine("\n");

            try
            {
                Console.Write("INFORME A OPÇÃO DESEJADA: ");
                var opcao = int.Parse(Console.ReadLine());

                switch (opcao)
                {
                case 1:
                    alunoController.Insetir();
                    Main(args);
                    break;

                case 2:
                    alunoController.Conlsultar();
                    Main(args);
                    break;

                case 3:
                    alunoController.Alterar();
                    Main(args);
                    break;

                case 4:
                    alunoController.Excluir();
                    Main(args);
                    break;

                case 0:
                    break;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("\n ERRO!" + e.Message);
            }

            Console.ReadKey();
        }
Пример #30
0
    // Update is called once per frame
    void Update()
    {
        if (!AlunoController.clicked)
        {
            GetInputDirection();
        }

        if (CanThrow())
        {
            MoveTo(AlunoController.GetAluno(new Vector2Int((int)(shooter.position.x + direction.y),
                                                           (int)(shooter.position.y + direction.x))));
        }
        DataCollector.posicaoCola = transform.position;
    }