Beispiel #1
0
        public bool Create(TaskP task)
        {
            TeamUpContext dbTask = new TeamUpContext();

            dbTask.Tasks.Add(task);
            dbTask.SaveChanges();
            return(true);
        }
Beispiel #2
0
        public void Update(TaskP task)
        {
            TeamUpContext dbTask = new TeamUpContext();
            var           taskDB = dbTask.Tasks.FirstOrDefault(x => x.TaskID == task.TaskID);

            taskDB.Name        = task.Name;
            taskDB.DateClose   = task.DateClose;
            taskDB.Description = task.Description;
            dbTask.SaveChanges();
        }
Beispiel #3
0
        public bool Edit(TaskModel tkM)
        {
            Mapping mapping = new Mapping();

            TaskP taskE = new TaskP();

            mapping.MapObjects(tkM, taskE);
            taskRepository.Update(taskE);


            return(true);
        }
Beispiel #4
0
        public bool Create(TaskModel taskM)
        {
            TaskP entity = new TaskP();

            Mapping mapping       = new Mapping();
            Account createAccount = new Account();
            Project orginProject  = new Project();


            mapping.MapObjects(taskM, entity);

            entity.ProjectID = taskM.Project;
            entity.UserName  = taskM.AccountCreator;

            return(taskRepository.Create(entity));
        }
Beispiel #5
0
        public TaskModel GetOne(int id)
        {
            TaskModel taskM   = new TaskModel();
            Mapping   mapping = new Mapping();

            TaskP taskDb = taskRepository.GetOne(id);

            if (taskDb != null)
            {
                mapping.MapObjects(taskDb, taskM);
            }

            taskM.AccountCreator = taskDb.UserName;
            taskM.Project        = taskDb.ProjectID;

            return(taskM);
        }
Beispiel #6
0
        public bool CloseOrOpen(int Id, bool CloseOrOpen)
        {
            TeamUpContext dbTask = new TeamUpContext();
            TaskP         task   = new TaskP();

            task = dbTask.Tasks.FirstOrDefault(x => x.TaskID == Id);


            if (task != null)
            {
                task.isClosed = CloseOrOpen;
                dbTask.SaveChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }