Пример #1
0
		private void updateSupportEntitiesForCreation(Solution e)
		{
			// is not optimal to get the whole document for adding to an internal array, but partial updates did not work...
			var entities = _models.Single<Presentation.Models.DefectHandling.SupportEntities>(
				Presentation.Models.DefectHandling.SupportEntities.TheId);
			var solutions = entities.Solutions ?? new List<Presentation.Models.DefectHandling.Solution>();
			solutions.Add(new Presentation.Models.DefectHandling.Solution
			              	{
			              		Id = e.Id.ToString(),
			              		Name = e.Name
			              	});
			entities.Solutions = solutions;
		}
Пример #2
0
		private void createSupportEntitiesFor(Solution e)
		{
			_models.Store(Presentation.Models.DefectHandling.SupportEntities.FirstWith(
				new Presentation.Models.DefectHandling.Solution {Id = e.Id.ToString(), Name = e.Name}));
		}
Пример #3
0
		private void createHandlingSnapshot(Solution e)
		{
			Domain.DefectHandling.Solution ds = new Domain.DefectHandling.Solution(e.Id, e.Name);
			_snapshots.Save(ds);
		}
Пример #4
0
		private void updateHandlingModel(Solution e)
		{
			if (!documentExists()) createSupportEntitiesFor(e);
			else updateSupportEntitiesForCreation(e);
		}
Пример #5
0
		private Solution createSnapshot(CreateSolution command)
		{
			Solution solution = new Solution(command.Name);
			_snapshots.Save(solution);
			return solution;
		}
Пример #6
0
		private void updateModelForCreation(Solution e)
		{
			_models.Store(new Presentation.Models.Admin.Solution {Id = e.Id.ToString(), Name = e.Name});
		}
Пример #7
0
		private void renameHandlingAssignedModels(Solution e)
		{
			var issues = _models.Query<Presentation.Models.DefectHandling.Issue, DefectHandling.Queries.IssuesAssignedToSolution>()
				.Where(i => i.Solution.Id == e.Id.ToString());
			foreach (var issue in issues)
			{
				issue.Solution.Name = e.Name;
			}
		}
Пример #8
0
		private void renameSupportEntities(Solution e)
		{
			// is not optimal to get the whole document for adding to an internal array, but partial updates did not work...
			var entities = _models.Single<Presentation.Models.DefectHandling.SupportEntities>(
				Presentation.Models.DefectHandling.SupportEntities.TheId);
			var toBeRenamed = entities.Solutions.Single(s => s.Id.Equals(e.Id.ToString(), StringComparison.Ordinal));
			toBeRenamed.Name = e.Name;
		}
Пример #9
0
		private void renameHandlingSnapshot(Solution e)
		{
			var solution = _snapshots.Single<Domain.DefectHandling.Solution>(s => s.Id.Equals(e.Id));
			solution.Name = e.Name;
			_snapshots.Save(solution);
		}
Пример #10
0
		private void renameAssignedModels(Solution e)
		{
			string indexName = typeof (Queries.VersionsAssignedToSolution).Name;
			Presentation.Models.Admin.AppVersion[] assignedVersions = _models.Query<Presentation.Models.Admin.AppVersion>(indexName)
				.Where(v => v.AssignedTo.Id == e.Id.ToString())
				.ToArray();
			Array.ForEach(assignedVersions, version => version.AssignedTo.Name = e.Name);

			indexName = typeof(Queries.BuildsAssignedToSolution).Name;
			Presentation.Models.Admin.Build[] assignedBuilds = _models.Query<Presentation.Models.Admin.Build>(indexName)
				.Where(v => v.AssignedTo.Id == e.Id.ToString())
				.ToArray();

			Array.ForEach(assignedBuilds, build => build.AssignedTo.Name = e.Name);
		}
Пример #11
0
		private void renameModel(Solution e)
		{
			var model = _models.Single<Presentation.Models.Admin.Solution>(e.Id);
			model.Name = e.Name;
		}