public void UpdateTaskDone(EditTaskDoneViewModel tdvm)
        {
            var       Config    = new MapperConfiguration(cfg => { cfg.CreateMap <EditTaskDoneViewModel, TasksDone>(); });
            IMapper   mapper    = Config.CreateMapper();
            TasksDone tasksDone = mapper.Map <EditTaskDoneViewModel, TasksDone>(tdvm);

            tdr.UpdateTaskDone(tasksDone);
        }
        public void InsertTaskDone(NewTaskDoneViewModel tdvm)
        {
            var       Config    = new MapperConfiguration(cfg => { cfg.CreateMap <NewTaskDoneViewModel, TasksDone>(); });
            IMapper   mapper    = Config.CreateMapper();
            TasksDone tasksDone = mapper.Map <NewTaskDoneViewModel, TasksDone>(tdvm);

            tdr.InsertTaskDone(tasksDone);
        }
Exemplo n.º 3
0
        public void DeleteTaskDone(int TaskDoneID)
        {
            TasksDone ExistingTaskDone = db.tasksDones.Where(temp => temp.TaskDoneID == TaskDoneID).FirstOrDefault();

            if (ExistingTaskDone != null)
            {
                db.tasksDones.Remove(ExistingTaskDone);
                db.SaveChanges();
            }
        }
Exemplo n.º 4
0
        public void UncheckTasks()
        {
            if (SelectedTasks != null)
            {
                _listTasks.Add(SelectedTasks);
                _listTasksDone.Remove(SelectedTasks);

                TasksDone.Refresh();
                Tasks.Refresh();
            }
        }
Exemplo n.º 5
0
        public void UpdateTaskDone(TasksDone Task)
        {
            TasksDone ExistingTaskDone = db.tasksDones.Where(temp => temp.TaskDoneID == Task.TaskDoneID).FirstOrDefault();

            if (ExistingTaskDone != null)
            {
                ExistingTaskDone.Screen = Task.Screen;
                ExistingTaskDone.TaskDoneDescription = Task.TaskDoneDescription;
                ExistingTaskDone.DateOfTaskDone      = Task.DateOfTaskDone;
                ExistingTaskDone.Attachments         = Task.Attachments;
                db.SaveChanges();
            }
        }
        public TaskDoneViewModel GetTasksDoneByID(int TasksDoneID)
        {
            TasksDone         tasksDone = tdr.GetTasksDoneByID(TasksDoneID);
            TaskDoneViewModel tdvm      = null;

            if (tasksDone != null)
            {
                var     Config = new MapperConfiguration(cfg => { cfg.CreateMap <TasksDone, TaskDoneViewModel>(); cfg.CreateMap <Users, UserViewModel>(); cfg.CreateMap <Tasks, TaskViewModel>(); });
                IMapper mapper = Config.CreateMapper();
                tdvm = mapper.Map <TasksDone, TaskDoneViewModel>(tasksDone);
                return(tdvm);
            }
            else
            {
                return(tdvm);
            }
        }
Exemplo n.º 7
0
        public ProfilViewModel()
        {
            _listTasks = new List <Tasks>
            {
                new Tasks(1, "Rendre TP C#", false, DateTime.Now.AddDays(15)),
                new Tasks(2, "Rendre TP Java", false, DateTime.Now.AddMonths(1)),
                new Tasks(3, "Terminer MSPR Oracle", false, DateTime.Now.AddDays(3))
            };
            Tasks = CollectionViewSource.GetDefaultView(_listTasks);
            Tasks.Refresh();

            _listTasksDone = new List <Tasks>
            {
                new Tasks(4, "Rendre TP Python", true, DateTime.Now.AddMonths(-2)),
                new Tasks(5, "Faire documentation technique projet POIN", true, DateTime.Now.AddDays(-45))
            };
            TasksDone = CollectionViewSource.GetDefaultView(_listTasksDone);
            TasksDone.Refresh();

            _listActivities = new List <Activity>
            {
                new Activity(1, "A mis 5 étoiles à l'extrait de code : Links To Css in HTML", DateTime.Now.AddDays(-2).ToString("dd/MM/yyyy")),
                new Activity(2, "A créé l'extrait de code : WPF Grid Exemple", "29/05/2020")
            };
            Activities = CollectionViewSource.GetDefaultView(_listActivities);
            Activities.Refresh();

            _listFavorites = new List <Favorite>
            {
                new Favorite("Links To Css in HTML", "ExtraitCodeHome"),
                new Favorite("WPF Grid Exemple", "ExtraitCodeHome")
            };
            Favorites = CollectionViewSource.GetDefaultView(_listFavorites);
            Favorites.Refresh();

            SelectedDate = DateTime.Today;
            ShowProfile  = true;
        }
Exemplo n.º 8
0
 public void InsertTaskDone(TasksDone Task)
 {
     db.tasksDones.Add(Task);
     db.SaveChanges();
 }
Exemplo n.º 9
0
        public TasksDone GetTasksDoneByID(int TasksDoneID)
        {
            TasksDone ExistingTaskDone = db.tasksDones.Where(temp => temp.TaskDoneID == TasksDoneID).FirstOrDefault();

            return(ExistingTaskDone);
        }