Esempio n. 1
0
        public override void Execute(object parameter)
        {
            var viewModelPrancha = parameter as PranchaViewModel;
            var prancha          = new ModelConcertosEntity.Prancha();
            PranchaController pranchaController = new PranchaController();

            pranchaController.ExcluirPrancha(viewModelPrancha.PranchaSelecionada.Id_Prancha);
            viewModelPrancha.Pranchas = pranchaController.GetPrancha();

            //var viewModel = (PranchaViewModel)parameter;
            //viewModel.Pranchas.Remove(viewModel.PranchaSelecionada);
            //viewModel.PranchaSelecionada = viewModel.Pranchas.FirstOrDefault();
        }
        public override void Execute(object parameter)
        {
            var viewModelPrancha = (PranchaViewModel)parameter;
            var prancha          = new ModelConcertosEntity.Prancha();

            var pw = new TelaAddPrancha();

            pw.DataContext = prancha;
            pw.ShowDialog();

            if (pw.DialogResult.HasValue && pw.DialogResult.Value)
            {
                PranchaController pranchaController = new PranchaController();
                pranchaController.InserirPrancha(prancha);
                viewModelPrancha.Pranchas = pranchaController.GetPrancha();
            }
        }
Esempio n. 3
0
        public PranchaViewModel()
        {
            PranchaController pranchaController = new PranchaController();

            Pranchas = pranchaController.GetPrancha();
        }