123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using WpfApp29.Models;
- namespace WpfApp29.ViewModels
- {
- class TaskDoerUserControlViewModel : BaseTaskUserControlViewModel
- {
- public TaskDoerUserControlViewModel() { }
- public TaskDoerUserControlViewModel(Task task) : base(task) { }
- public RelayCommand? _commandDeclineTask;
- public RelayCommand? CommandDeclineTask
- {
- get
- {
- return _commandDeclineTask ??= new RelayCommand(
- x =>
- {
- MainContext ctx = new MainContext();
- ctx.Tasks.ToList().First(t => Task.Id == t.Id).StatusId = 1;
- ctx.SaveChanges();
- });
- }
- }
- public RelayCommand? _commandDoneTask;
- public RelayCommand? CommandDoneTask
- {
- get
- {
- return _commandDoneTask ??= new RelayCommand(
- x =>
- {
- MainContext ctx = new MainContext();
- ctx.Tasks.ToList().First(t => Task.Id == t.Id).StatusId = 3;
- ctx.SaveChanges();
- });
- }
- }
- }
- }
|