예제 #1
0
 public static List <Task> select(User requester, int projectId)
 {
     try
     {
         nova_ataEntities db          = new nova_ataEntities();
         List <Task>      listOfTasks = new List <Task>();
         var tasks = from t in db.tasks
                     where t.projectId == projectId && t.wasDeleted == "false"
                     select t;
         foreach (var t in tasks)
         {
             Task task = new Task(t.taskId, t.projectId, t.notifyMe, t.meetingDate, t.product, t.pWork, t.criticalActivity,
                                  t.activityTitle, t.activityDescription, t.parent, t.grandParent, t.responsible, t.start, t.finish,
                                  t.status, CommentDAO.selectLastComment(t.taskId), t.activityOrigin, t.idProjectTask, t.idParentProjectTask,
                                  t.ident, t.hash, t.delayReason, t.delayDescription, UserDAO.instanceById((int)t.createdBy),
                                  (int)t.reworkCount, t.actualFinishDate, t.newStart, t.newFinish, t.isFreezed, t.wasDeleted,
                                  t.wasInsertedAfterFreezing);
             listOfTasks.Add(task);
         }
         return(listOfTasks);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
예제 #2
0
 public static Task instanceById(int taskId)
 {
     try
     {
         nova_ataEntities db = new nova_ataEntities();
         var  t    = db.tasks.Find(taskId);
         Task task = new Task(t.taskId, t.projectId, t.notifyMe, t.meetingDate, t.product, t.pWork, t.criticalActivity,
                              t.activityTitle, t.activityDescription, t.parent, t.grandParent, t.responsible, t.start, t.finish,
                              t.status, CommentDAO.selectLastComment(t.taskId), t.activityOrigin, t.idProjectTask, t.idParentProjectTask,
                              t.ident, t.hash, t.delayDescription, t.delayDescription, UserDAO.instanceById((int)t.createdBy),
                              (int)t.reworkCount, t.actualFinishDate, t.newStart, t.newFinish, t.isFreezed, t.wasDeleted,
                              t.wasInsertedAfterFreezing);
         return(task);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }