Пример #1
0
        private ITask GetTasksFromCard(Card card)
        {
            var task = new TaskMain();

            try
            {
                task.TaskID        = card.Name.Substring(card.Name.IndexOf("<") + 1, card.Name.IndexOf(">") - card.Name.IndexOf("<") - 1);
                task.Summary       = card.Name.Remove(card.Name.IndexOf("<"), card.Name.IndexOf(">") - card.Name.IndexOf("<") + 1);
                task.Assigned      = null;
                task.Description   = card.Desc;
                task.Status        = _trello.Lists.ForCard(card).Name;
                task.Project       = _trello.Boards.ForCard(card).Name;
                task.Priority      = card.Badges.Votes.ToString();
                task.TokenID       = TokenID;
                task.TargetVersion = card.Due.ToString();
                var comments = _trello.Actions
                               .AutoPaged(Paging.MaxLimit)
                               .ForCard(card, new[] { ActionType.CommentCard })
                               .OfType <CommentCardAction>();
                foreach (var comment in comments)
                {
                    task.Comments = task.Comments + comment.Data.Text + " :By " + comment.MemberCreator.FullName + " At: " + comment.Date.ToString() + "; ";
                }
                task.Source        = Sources.Trello;
                task.LinkToTracker = card.Url;
                return(task);
            }
            catch (System.ArgumentOutOfRangeException)
            {
                task.TaskID        = card.Name;
                task.Assigned      = null;
                task.Description   = card.Desc;
                task.Status        = _trello.Lists.ForCard(card).Name;
                task.Project       = _trello.Boards.ForCard(card).Name;
                task.Priority      = card.Badges.Votes.ToString();
                task.TargetVersion = card.Due.ToString();
                task.TokenID       = TokenID;
                var comments = _trello.Actions
                               .AutoPaged(Paging.MaxLimit)
                               .ForCard(card, new[] { ActionType.CommentCard })
                               .OfType <CommentCardAction>();
                foreach (var comment in comments)
                {
                    task.Comments = task.Comments + comment.Data.Text + " :By " + comment.MemberCreator.FullName + " At: " + comment.Date.ToString() + "; ";
                }
                task.Source        = Sources.Trello;
                task.LinkToTracker = card.GetCardId();
                return(task);
            }
        }
Пример #2
0
        private TaskMain GetRowElements(ListEntry row)
        {
            TaskMain tm = new TaskMain();

            tm.LinkToTracker = row.Feed.Entries.FirstOrDefault().Feed.Links.First().AbsoluteUri.ToString();
            var str = row.Links;

            tm.TaskID = row.Elements[0].Value;
            if (tm.TaskID == "")
            {
                tm.TaskID = row.Elements[1].Value;
            }
            tm.Description = row.Elements[3].Value;
            tm.Status      = row.Elements[5].Value;
            tm.Comments    = row.Elements[6].Value;
            tm.Source      = Sources.GoogleSheets;

            return(tm);
        }
Пример #3
0
        public IList <ITask> GetAllTasks()
        {
            IList <ITask> issues = new List <ITask>();

            foreach (DatabaseAccountToken token in allTokensInAccount)
            {
                var clientDBFactory = allFactories.GetSessionFactory(token);

                using (var session = clientDBFactory.OpenSession())
                {
                    IList <DBTask> listTask = session.QueryOver <DBTask>().List();
                    foreach (DBTask issue in listTask)
                    {
                        TaskMain task = new TaskMain();

                        task.TokenID       = token.TokenId;
                        task.Source        = Sources.DataBase;
                        task.Assigned      = issue.Assigned;
                        task.Comments      = issue.Comments;
                        task.CreatedBy     = issue.CreatedBy;
                        task.CreatedDate   = issue.CreatedDate;
                        task.Description   = issue.Description;
                        task.Estimation    = issue.Estimation;
                        task.Priority      = issue.Priority;
                        task.Product       = issue.Product;
                        task.Project       = issue.Project;
                        task.Status        = issue.Status;
                        task.SubtaskType   = issue.SubtaskType;
                        task.Summary       = issue.Summary;
                        task.TargetVersion = issue.TargetVersion;
                        task.TaskID        = issue.TaskID;
                        task.TaskParent    = issue.TaskParent;
                        task.LinkToTracker = token.ConnectionString;

                        issues.Add(task);
                    }
                }
            }

            return(issues);
        }
        private static ITask TaskMainDaoToTaskMainWithoutMatchedTasks(TaskMainDAO taskMainDAO)
        {
            TaskKey taskKey = taskMainDAO.GetTaskKey();
            ITask taskMain = GetExistingTask(taskKey);
            if (taskMain == null)
            {
                taskMain = new TaskMain();
                taskMain.TaskID = taskMainDAO.TaskID;
                taskMain.TargetVersion = taskMainDAO.TargetVersion;
                taskMain.Summary = taskMainDAO.Summary;
                taskMain.SubtaskType = taskMainDAO.SubtaskType;
                taskMain.Status = taskMainDAO.Status;
                taskMain.Project = taskMainDAO.Project;
                taskMain.Product = taskMainDAO.Product;
                taskMain.Priority = taskMainDAO.Priority;
                taskMain.LinkToTracker = taskMainDAO.LinkToTracker;
                taskMain.Estimation = taskMainDAO.Estimation;
                taskMain.Description = taskMainDAO.Description;
                taskMain.CreatedDate = taskMainDAO.CreatedDate;
                taskMain.CreatedBy = taskMainDAO.CreatedBy;
                taskMain.Comments = taskMainDAO.Comments;
                taskMain.TokenID = taskMainDAO.TokenID;
                taskMain.Source = taskMainDAO.Source;

                if (taskMainDAO.TaskParent != null)
                {
                    taskMain.TaskParent = TaskMainDaoToTaskMain(taskMainDAO.TaskParent);
                }

                if (taskMainDAO.Assigned != null && taskMainDAO.Assigned.Count > 0)
                {
                    taskMain.Assigned = UserDaoToUser(taskMainDAO.Assigned);
                }

                taskMainCollection.Add(taskKey, taskMain);
            }
            if (taskMain != null)
            {
                taskMain.TaskID = taskMainDAO.TaskID;
                taskMain.TargetVersion = taskMainDAO.TargetVersion;
                taskMain.Summary = taskMainDAO.Summary;
                taskMain.SubtaskType = taskMainDAO.SubtaskType;
                taskMain.Status = taskMainDAO.Status;
                taskMain.Project = taskMainDAO.Project;
                taskMain.Product = taskMainDAO.Product;
                taskMain.Priority = taskMainDAO.Priority;
                taskMain.LinkToTracker = taskMainDAO.LinkToTracker;
                taskMain.Estimation = taskMainDAO.Estimation;
                taskMain.Description = taskMainDAO.Description;
                taskMain.CreatedDate = taskMainDAO.CreatedDate;
                taskMain.CreatedBy = taskMainDAO.CreatedBy;
                taskMain.Comments = taskMainDAO.Comments;
                taskMain.TokenID = taskMainDAO.TokenID;
                taskMain.Source = taskMainDAO.Source;

                if (taskMainDAO.TaskParent != null)
                {
                    taskMain.TaskParent = TaskMainDaoToTaskMain(taskMainDAO.TaskParent);
                }

                if (taskMainDAO.Assigned != null && taskMainDAO.Assigned.Count > 0)
                {
                    taskMain.Assigned = UserDaoToUser(taskMainDAO.Assigned);
                }
            }
            return taskMain;
        }
Пример #5
0
        private static ITask TaskMainDaoToTaskMainWithoutMatchedTasks(TaskMainDAO taskMainDAO)
        {
            TaskKey taskKey  = taskMainDAO.GetTaskKey();
            ITask   taskMain = GetExistingTask(taskKey);

            if (taskMain == null)
            {
                taskMain               = new TaskMain();
                taskMain.TaskID        = taskMainDAO.TaskID;
                taskMain.TargetVersion = taskMainDAO.TargetVersion;
                taskMain.Summary       = taskMainDAO.Summary;
                taskMain.SubtaskType   = taskMainDAO.SubtaskType;
                taskMain.Status        = taskMainDAO.Status;
                taskMain.Project       = taskMainDAO.Project;
                taskMain.Product       = taskMainDAO.Product;
                taskMain.Priority      = taskMainDAO.Priority;
                taskMain.LinkToTracker = taskMainDAO.LinkToTracker;
                taskMain.Estimation    = taskMainDAO.Estimation;
                taskMain.Description   = taskMainDAO.Description;
                taskMain.CreatedDate   = taskMainDAO.CreatedDate;
                taskMain.CreatedBy     = taskMainDAO.CreatedBy;
                taskMain.Comments      = taskMainDAO.Comments;
                taskMain.TokenID       = taskMainDAO.TokenID;
                taskMain.Source        = taskMainDAO.Source;

                if (taskMainDAO.TaskParent != null)
                {
                    taskMain.TaskParent = TaskMainDaoToTaskMain(taskMainDAO.TaskParent);
                }

                if (taskMainDAO.Assigned != null && taskMainDAO.Assigned.Count > 0)
                {
                    taskMain.Assigned = UserDaoToUser(taskMainDAO.Assigned);
                }

                taskMainCollection.Add(taskKey, taskMain);
            }
            if (taskMain != null)
            {
                taskMain.TaskID        = taskMainDAO.TaskID;
                taskMain.TargetVersion = taskMainDAO.TargetVersion;
                taskMain.Summary       = taskMainDAO.Summary;
                taskMain.SubtaskType   = taskMainDAO.SubtaskType;
                taskMain.Status        = taskMainDAO.Status;
                taskMain.Project       = taskMainDAO.Project;
                taskMain.Product       = taskMainDAO.Product;
                taskMain.Priority      = taskMainDAO.Priority;
                taskMain.LinkToTracker = taskMainDAO.LinkToTracker;
                taskMain.Estimation    = taskMainDAO.Estimation;
                taskMain.Description   = taskMainDAO.Description;
                taskMain.CreatedDate   = taskMainDAO.CreatedDate;
                taskMain.CreatedBy     = taskMainDAO.CreatedBy;
                taskMain.Comments      = taskMainDAO.Comments;
                taskMain.TokenID       = taskMainDAO.TokenID;
                taskMain.Source        = taskMainDAO.Source;

                if (taskMainDAO.TaskParent != null)
                {
                    taskMain.TaskParent = TaskMainDaoToTaskMain(taskMainDAO.TaskParent);
                }

                if (taskMainDAO.Assigned != null && taskMainDAO.Assigned.Count > 0)
                {
                    taskMain.Assigned = UserDaoToUser(taskMainDAO.Assigned);
                }
            }
            return(taskMain);
        }
Пример #6
0
        public IList<ITask> GetAllTasks()
        {
            IList<ITask> issues = new List<ITask>();
            foreach (DatabaseAccountToken token in allTokensInAccount)
            {
                var clientDBFactory = allFactories.GetSessionFactory(token);

                using (var session = clientDBFactory.OpenSession())
                {
                    IList<DBTask> listTask = session.QueryOver<DBTask>().List();
                    foreach (DBTask issue in listTask)
                    {
                        TaskMain task = new TaskMain();

                        task.TokenID = token.TokenId;
                        task.Source = Sources.DataBase;
                        task.Assigned = issue.Assigned;
                        task.Comments = issue.Comments;
                        task.CreatedBy = issue.CreatedBy;
                        task.CreatedDate = issue.CreatedDate;
                        task.Description = issue.Description;
                        task.Estimation = issue.Estimation;
                        task.Priority = issue.Priority;
                        task.Product = issue.Product;
                        task.Project = issue.Project;
                        task.Status = issue.Status;
                        task.SubtaskType = issue.SubtaskType;
                        task.Summary = issue.Summary;
                        task.TargetVersion = issue.TargetVersion;
                        task.TaskID = issue.TaskID;
                        task.TaskParent = issue.TaskParent;
                        task.LinkToTracker = token.ConnectionString;

                        issues.Add(task);
                    }
                }
            }

            return issues;
        }
Пример #7
0
        private TaskMain GetRowElements(ListEntry row)
        {
            TaskMain tm = new TaskMain();

            tm.LinkToTracker= row.Feed.Entries.FirstOrDefault().Feed.Links.First().AbsoluteUri.ToString();
            var str = row.Links;
            tm.TaskID = row.Elements[0].Value;
            if (tm.TaskID == "")
                tm.TaskID = row.Elements[1].Value;
            tm.Description = row.Elements[3].Value;
            tm.Status = row.Elements[5].Value;
            tm.Comments = row.Elements[6].Value;
            tm.Source = Sources.GoogleSheets;

            return tm;
        }
Пример #8
0
        private void Write_list(List<KeyValuePair<String, String>> oneTask)
        {
            ExcelAccountTemplate template = currentAccount.Template.FirstOrDefault();
            if (template == null)
            {
                return;
            }
            TaskMain task = new TaskMain();

            task.TaskID = (from keyValue in oneTask
                           where keyValue.Key == template.TaskID
                           select keyValue.Value).SingleOrDefault<String>();

            task.Summary = (from keyValue in oneTask
                            where keyValue.Key == template.Summary
                            select keyValue.Value).SingleOrDefault<String>();

            task.SubtaskType = (from keyValue in oneTask
                                where keyValue.Key == template.SubtaskType
                                select keyValue.Value).SingleOrDefault<String>();

            task.Status = (from keyValue in oneTask
                           where keyValue.Key == template.Status
                           select keyValue.Value).SingleOrDefault<String>();

            task.Priority = (from keyValue in oneTask
                             where keyValue.Key == template.Priority
                             select keyValue.Value).SingleOrDefault<String>();

            task.CreatedDate = (from keyValue in oneTask
                                where keyValue.Key == template.CreatedDate
                                select keyValue.Value).SingleOrDefault<String>();

            task.CreatedBy = (from keyValue in oneTask
                              where keyValue.Key == template.CreatedBy
                              select keyValue.Value).SingleOrDefault<String>();

            task.Description = (from keyValue in oneTask
                                where keyValue.Key == template.Description
                                select keyValue.Value).SingleOrDefault<String>();

            task.Product = (from keyValue in oneTask
                            where keyValue.Key == template.Product
                            select keyValue.Value).SingleOrDefault<String>();

            task.Project = (from keyValue in oneTask
                            where keyValue.Key == template.Project
                            select keyValue.Value).SingleOrDefault<String>();

            task.Estimation = (from keyValue in oneTask
                               where keyValue.Key == template.Estimation
                               select keyValue.Value).SingleOrDefault<String>();

            task.TargetVersion = (from keyValue in oneTask
                                  where keyValue.Key == template.TargetVersion
                                  select keyValue.Value).SingleOrDefault<String>();

            task.Comments = (from keyValue in oneTask
                             where keyValue.Key == template.Comments
                             select keyValue.Value).SingleOrDefault<String>();

            var parentTask = (from keyValue in oneTask
                              where keyValue.Key == template.TaskParent
                              select keyValue.Value).SingleOrDefault<String>();
            if (!String.IsNullOrEmpty(parentTask))
            {
                parentTasks.Add(task.TaskID, parentTask);
            }

            var assigned = (from keyValue in oneTask
                              where keyValue.Key == template.Assigned
                              select keyValue.Value).SingleOrDefault<String>();
            if (!String.IsNullOrEmpty(assigned))
            {
                UserDAO user = UserDAO.FindUserFromDBByName(assigned);
                if (user != null)
                {
                    task.Assigned.Add(ConverterDAOtoDomain.UserDaoToUser(user));
                }
            }

            task.LinkToTracker = (from token in currentAccount.Tokens
                                  where token.TokenId == tokenID
                                  select token.TokenName).SingleOrDefault();

            task.Source = Sources.Excel;

            task.TokenID = tokenID;

            list_task.Add(task);
        }
Пример #9
0
        private void Write_list(List <KeyValuePair <String, String> > oneTask)
        {
            ExcelAccountTemplate template = currentAccount.Template.FirstOrDefault();

            if (template == null)
            {
                return;
            }
            TaskMain task = new TaskMain();

            task.TaskID = (from keyValue in oneTask
                           where keyValue.Key == template.TaskID
                           select keyValue.Value).SingleOrDefault <String>();

            task.Summary = (from keyValue in oneTask
                            where keyValue.Key == template.Summary
                            select keyValue.Value).SingleOrDefault <String>();

            task.SubtaskType = (from keyValue in oneTask
                                where keyValue.Key == template.SubtaskType
                                select keyValue.Value).SingleOrDefault <String>();

            task.Status = (from keyValue in oneTask
                           where keyValue.Key == template.Status
                           select keyValue.Value).SingleOrDefault <String>();

            task.Priority = (from keyValue in oneTask
                             where keyValue.Key == template.Priority
                             select keyValue.Value).SingleOrDefault <String>();

            task.CreatedDate = (from keyValue in oneTask
                                where keyValue.Key == template.CreatedDate
                                select keyValue.Value).SingleOrDefault <String>();

            task.CreatedBy = (from keyValue in oneTask
                              where keyValue.Key == template.CreatedBy
                              select keyValue.Value).SingleOrDefault <String>();

            task.Description = (from keyValue in oneTask
                                where keyValue.Key == template.Description
                                select keyValue.Value).SingleOrDefault <String>();

            task.Product = (from keyValue in oneTask
                            where keyValue.Key == template.Product
                            select keyValue.Value).SingleOrDefault <String>();

            task.Project = (from keyValue in oneTask
                            where keyValue.Key == template.Project
                            select keyValue.Value).SingleOrDefault <String>();

            task.Estimation = (from keyValue in oneTask
                               where keyValue.Key == template.Estimation
                               select keyValue.Value).SingleOrDefault <String>();

            task.TargetVersion = (from keyValue in oneTask
                                  where keyValue.Key == template.TargetVersion
                                  select keyValue.Value).SingleOrDefault <String>();

            task.Comments = (from keyValue in oneTask
                             where keyValue.Key == template.Comments
                             select keyValue.Value).SingleOrDefault <String>();

            var parentTask = (from keyValue in oneTask
                              where keyValue.Key == template.TaskParent
                              select keyValue.Value).SingleOrDefault <String>();

            if (!String.IsNullOrEmpty(parentTask))
            {
                parentTasks.Add(task.TaskID, parentTask);
            }

            var assigned = (from keyValue in oneTask
                            where keyValue.Key == template.Assigned
                            select keyValue.Value).SingleOrDefault <String>();

            if (!String.IsNullOrEmpty(assigned))
            {
                UserDAO user = UserDAO.FindUserFromDBByName(assigned);
                if (user != null)
                {
                    task.Assigned.Add(ConverterDAOtoDomain.UserDaoToUser(user));
                }
            }

            task.LinkToTracker = (from token in currentAccount.Tokens
                                  where token.TokenId == tokenID
                                  select token.TokenName).SingleOrDefault();


            task.Source = Sources.Excel;

            task.TokenID = tokenID;

            list_task.Add(task);
        }