Ejemplo n.º 1
0
        public IQueryable<Project> GetProjects()
        {
            KanbanBoard.Data.KanbanTFSEntities kt = new KanbanTFSEntities();

            var result = from prj in kt.Projects
                         select prj;
            return result;
        }
Ejemplo n.º 2
0
        public IQueryable<ProjectStatus> GetProjectStatuses( int projectID)
        {
            KanbanBoard.Data.KanbanTFSEntities kt = new KanbanTFSEntities();

            var result = from prj in kt.ProjectStatus1
                         where prj.ProjectID == projectID
                         select prj;
            return result;
        }
Ejemplo n.º 3
0
 public bool Delete(Task task)
 {
     KanbanBoard.Data.KanbanTFSEntities kt = new KanbanTFSEntities();
     Task t = new Task() { TaskID = task.TaskID };
     kt.Tasks.Attach(t);
     kt.Tasks.Remove(t);
     kt.SaveChanges();
     return true;
 }
Ejemplo n.º 4
0
        public IQueryable<User> GetProjectUsers(int projectID)
        {
            KanbanBoard.Data.KanbanTFSEntities kt = new KanbanTFSEntities();

            var result = from prj in kt.Projects
                         from usr in prj.Users
                         where prj.ProjectID == projectID
                         select usr;
            return result;
        }
Ejemplo n.º 5
0
        public ICollection<Project> GetProjectsForUser(int userID)
        {
            KanbanBoard.Data.KanbanTFSEntities kt = new KanbanTFSEntities();

            var result = from usr in kt.Users
                         where usr.UserID == userID
                         select usr;
            foreach (var usr in result)
            {
                return usr.Projects;
            }
            return null;
        }
Ejemplo n.º 6
0
        public ICollection<BoardItem> GetProjectBoard(int projectID)
        {
            KanbanBoard.Data.KanbanTFSEntities kt = new KanbanTFSEntities();

            List<BoardItem> lst = new List<BoardItem>();
            var result = kt.GetProjectBoard(projectID);

            foreach (var res in result)
            {
                lst.Add(new BoardItem(res));
            }
            return lst;
        }
Ejemplo n.º 7
0
 public Task UpdateTask(Task task)
 {
     Task ret = null;
     KanbanBoard.Data.KanbanTFSEntities kt = new KanbanTFSEntities();
     bool taskFound = false;
     var result = from tsk in kt.Tasks
                  where tsk.TaskID == task.TaskID
                  select tsk;
     foreach (var tsk in result)
     {
         taskFound = true;
         tsk.ProjectID = task.ProjectID;
         tsk.TFSTaskID = task.TFSTaskID;
         tsk.Title = task.Title;
         tsk.Descriptions = task.Descriptions;
         tsk.UserID = task.UserID;
         tsk.StatusID = task.StatusID;
         ret = tsk;
     }
     if (taskFound == false)
     {
         ret = task;
         kt.Tasks.Add(task);
     }
     kt.SaveChanges();
     return ret;
 }