예제 #1
0
        public override void AddData()
        {
            var turmas = _turmaService.GetAll();

            var dialog = new AlunoDialog(turmas);

            dialog.Aluno = new AlunoDTO();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                _alunoService.Add(dialog.Aluno);

                _control.RefreshGrid();
            }
        }
예제 #2
0
        public override void AddData()
        {
            var turmas = _turmaService.GetAll();

            var dialog = new AlunoDialog(turmas);

            dialog.Aluno = new AlunoDTO();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                _alunoService.Add(dialog.Aluno);

                _control.RefreshGrid();
            }
        }
예제 #3
0
        public override void UpdateData()
        {
            AlunoDTO aluno = _control.GetAluno();

            if (aluno == null)
            {
                MessageBox.Show("Nenhum aluno selecionado. Selecionar um aluno antes de solicitar a edição");
                return;
            }

            var turmas = _turmaService.GetAll();

            var dialog = new AlunoDialog(turmas);

            dialog.Aluno = aluno;

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                _alunoService.Update(dialog.Aluno);
                _control.RefreshGrid();
            }
        }
예제 #4
0
        public override void UpdateData()
        {
            AlunoDTO aluno = _control.GetAluno();

            if (aluno == null)
            {
                MessageBox.Show("Nenhum aluno selecionado. Selecionar um aluno antes de solicitar a edição");
                return;
            }

            var turmas = _turmaService.GetAll();

            var dialog = new AlunoDialog(turmas);

            dialog.Aluno = aluno;

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                _alunoService.Update(dialog.Aluno);
                _control.RefreshGrid();
            }
        }