Check Unmerged Solution Owners


Check Unmerged Solution Owners



internal void CheckUnmergedSolutionOwners(SourceControlBranchEntity parentBranch, SourceControlBranchEntity branch, bool excludeNonReferencedSolutions)
{
ObligationType obligationType = GetObligationType(branch.SourceControlBranchName);
if (branch != null && branch.RootBranchOperationId.GetValueOrDefault() > 0)
{
parentBranch = SourceControlBranchComponent.GetSourceControlBranchEntity(branch.RootBranchOperationId.Value);
var solutions = SolutionComponent.GetSolutionEntityListByBranch(branch.SourceControlBranchOperationId);
Dictionary<string, string>; unmergedSolutionOwners = new SourcePackagingService.SourcePackagingServiceClient().GetUnmergedSolutionOwners(new SourcePackagingService.SourcePackagingParentBranchInput
{
ParentBranchName = parentBranch == null ? "" : parentBranch.SourceControlBranchName,
SolutionNames = solutions.Select(x => x.SolutionName).ToArray(),
BranchName = branch.SourceControlBranchName,
TeamProject = branch.TeamProjectId.ToStringLocalized(),
TfsAddress = ConfigurationManager.TfSettings.Application.CustomSettings["TFSAddress"],
RequestedBy = DeploymentItemComponent.GetCallerClientUserName(),
OptionalNotification = (obligationType == ObligationType.Optional) ? true : false
}, excludeNonReferencedSolutions);
foreach (var item in unmergedSolutionOwners)
{
string organizationUnitName = string.Empty;
var solution = solutions
.Where(x => x.SolutionName == item.Key)
.FirstOrDefault();
if (solution != null)
{
organizationUnitName = AuthorizationComponent.GetOrganizationUnitName(solution.ResponsibleOrganizationUnitId);
}
AddResult(DeploymentItemValidationType.MergeSolutionBeforeBranchUpdate, false, obligationType, new string[] { item.Key, item.Value, organizationUnitName });
}

}
else
{
AddResult(DeploymentItemValidationType.BranchOrParentBranchNotFound, false, ObligationType.Mandatory);
}

}

Yorumlar

Bu blogdaki popüler yayınlar

HOŞ GELDİNİZ

List String Equals