public ConsultarCursosViewModel()
        {
            this.Periodos = new List<ConsultarPeriodosPeriodoDTO>();
            var task = new Task(() =>
            {
                Status = "Consultando Períodos...";
                var modelPeriodos = new ConsultarPeriodosModel();
                var requestPeriodos = new ConsultarPeriodosRequest();
                modelPeriodos.Execute(requestPeriodos);

                if (modelPeriodos.Response.Status == ExecutionStatus.Success) this.Periodos = modelPeriodos.Response.Periodos;
                else System.Windows.Forms.MessageBox.Show(string.Concat("Erro ao consultar professores:\n",modelPeriodos.ErrorMessage));
                Periodos.Add(new ConsultarPeriodosPeriodoDTO() { Codigo = 0, Nome = "<Nenhum>" });


                Status = "Consultando Cursos...";
                var modelCursos = new ConsultarCursosModel();
                var requestCursos = new ConsultarCursosRequest();
                modelCursos.Execute(requestCursos);

                if (modelCursos.Response.Status == ExecutionStatus.Success) this.Lista = modelCursos.Response.Cursos;
                else System.Windows.Forms.MessageBox.Show(string.Concat("Erro ao consultar professores:\n",modelCursos.ErrorMessage));
            });
            task.ContinueWith(x =>
            {
                Status = "";
            });

            task.Start();
            this.ActionCommand = new RelayCommand();
        }
        public CadastrarCursoViewModel()
        {
            CriarEnabled = true;
            CancelarEnabled = true;
            ActionCommandCriar = new RelayCommand();
            ActionCommandCancelar = new RelayCommand();

            new Task(() =>
            {
                Status = "Consultando Períodos...";
                var model = new ConsultarPeriodosModel();
                model.Execute(new ConsultarPeriodosRequest());

                if (model.Response.Status == ExecutionStatus.Success) Lista = model.Response.Periodos;
                else MessageBox.Show(string.Concat("Erro ao consultar os períodos:\n", model.Response.ErrorMessage));

                Status = string.Empty;
            }).Start();
        }
        public ConsultarPeriodosViewModel()
        {
            var task = new Task(() =>
            {
                Status = "Consultando...";
                var model = new ConsultarPeriodosModel();
                var request = new ConsultarPeriodosRequest();
                model.Execute(request);

                if (model.Response.Status == ExecutionStatus.Success) this.Lista = model.Response.Periodos;
                else System.Windows.Forms.MessageBox.Show(string.Concat("Erro ao consultar professores:\n",model.Response.ErrorMessage));
            });
            task.ContinueWith(x =>
            {
                Status = "";
            });

            task.Start();
            this.ActionCommand = new RelayCommand();
        }