Exemple #1
0
        public void AddComment(Bug bug)
        {
            var workItemDao = new WorkItemDao
            {
                Id          = bug.Id,
                Description = bug.Description,
            };
            var workItemSql = OperationsHelper.BuildUpdateStatement(workItemDao.GetTableName(), nameof(workItemDao.Id),
                                                                    nameof(workItemDao.Description));

            AddChange(workItemSql, workItemDao, OperationType.UPDATE);

            var bugDao = new BugDao
            {
                Id = bug.Id,
                IntegratedInBuild = bug.IntegratedInBuild,
                FoundInBuild      = bug.FoundInBuild,
                SystemInfo        = bug.SystemInfo
            };
            var bugSql =
                OperationsHelper.BuildUpdateStatement(bugDao.GetTableName(), nameof(bug.Id),
                                                      nameof(bugDao.IntegratedInBuild), nameof(bugDao.FoundInBuild), nameof(bugDao.SystemInfo));

            AddChange(bugSql, bugDao, OperationType.UPDATE);
        }
Exemple #2
0
        public void ChangeState(Bug bug)
        {
            var workItemDao = new WorkItemDao
            {
                Id            = bug.Id,
                StateId       = (int)bug.State,
                StateReasonId = (int)bug.StateReason,
            };

            workItemDao.IncludeDomainEvents(bug.DomainEvents);

            var workItemSql = OperationsHelper.BuildUpdateStatement(workItemDao.GetTableName(), nameof(workItemDao.Id),
                                                                    nameof(workItemDao.StateId), nameof(workItemDao.StateReasonId));

            AddChange(workItemSql, workItemDao, OperationType.UPDATE);
        }
Exemple #3
0
        public void ModifyPlanning(Bug bug)
        {
            var workItemDao = new WorkItemDao
            {
                Id         = bug.Id,
                PriorityId = (int)bug.Priority,
            };
            var workItemSql = OperationsHelper.BuildUpdateStatement(workItemDao.GetTableName(), nameof(workItemDao.Id),
                                                                    nameof(workItemDao.PriorityId));

            AddChange(workItemSql, workItemDao, OperationType.UPDATE);

            var bugDao = new BugDao(bug);
            var bugSql =
                OperationsHelper.BuildUpdateStatement(bugDao.GetTableName(), nameof(bug.Id),
                                                      nameof(bugDao.StoryPoints), nameof(bugDao.SeverityId), nameof(bugDao.ActivityId));

            AddChange(bugSql, bugDao, OperationType.UPDATE);
        }
Exemple #4
0
        public void Insert(Bug bug)
        {
            var workItemDao = new WorkItemDao(bug);

            AddChange(workItemDao.BuildInsertStatement(), workItemDao, OperationType.INSERT);

            var bugDao = new BugDao(bug);

            AddChange(bugDao.BuildInsertStatement(), bugDao, OperationType.INSERT);

            using (var enumerator = bug.Attachments.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    var attachmentDao = new AttachmentDao
                    {
                        Path     = enumerator.Current !.Path, FileName = enumerator.Current.FileName,
                        MimeType = enumerator.Current.MimeType, WorkItemId = bug.Id
                    };
                    AddChange(attachmentDao.BuildInsertStatement(), attachmentDao, OperationType.INSERT);
                }
            }

            foreach (var tag in bug.Tags)
            {
                var tagDao = new TagDao {
                    Text = tag.Text, WorkItemId = bug.Id
                };
                AddChange(tagDao.BuildInsertStatement(), tagDao, OperationType.INSERT);
            }

            foreach (var relatedWork in bug.RelatedWorks)
            {
                var relatedWorkDao = new RelatedWorkDao(relatedWork, bugDao.Id);
                AddChange(relatedWorkDao.BuildInsertStatement(), relatedWorkDao, OperationType.INSERT);
            }
        }