本文整理汇总了C#中VersionOne.SDK.APIClient.Asset.SetAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:C# Asset.SetAttributeValue方法的具体用法?C# Asset.SetAttributeValue怎么用?C# Asset.SetAttributeValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VersionOne.SDK.APIClient.Asset
的用法示例。
在下文中一共展示了Asset.SetAttributeValue方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTeam
protected Asset CreateTeam(string name)
{
var teamNameDef = MetaModel.GetAttributeDefinition("Team.Name");
var assetTeam = new Asset(MetaModel.GetAssetType("Team"));
assetTeam.SetAttributeValue(teamNameDef, name);
Services.Save(assetTeam);
return assetTeam;
}
示例2: UpdateOpenTest
private void UpdateOpenTest(Oid newStatus, Asset test) {
var statusAttribute = test.GetAttribute(TestStatusDef);
var statusOid = (Oid)statusAttribute.Value;
if(newStatus != statusOid) {
test.SetAttributeValue(TestStatusDef, newStatus);
Services.Save(test, changeComment);
Logger.Log(string.Format("Updating status of Acceptance Test \"{0}\".", test.Oid.Token));
}
}
示例3: CreateSprint
protected Asset CreateSprint(string name, Oid scheduleOid)
{
var timeboxNameDef = MetaModel.GetAttributeDefinition("Timebox.Name");
var timeboxEndDateDef = MetaModel.GetAttributeDefinition("Timebox.EndDate");
var timeboxBeginDateDef = MetaModel.GetAttributeDefinition("Timebox.BeginDate");
var timeboxStateDef = MetaModel.GetAttributeDefinition("Timebox.State");
var timeboxScheduleDef = MetaModel.GetAttributeDefinition("Timebox.Schedule");
var assetTimeBox = new Asset(MetaModel.GetAssetType("Timebox"));
assetTimeBox.SetAttributeValue(timeboxNameDef, name);
assetTimeBox.SetAttributeValue(timeboxEndDateDef, DateTime.Now.AddDays(5));
assetTimeBox.SetAttributeValue(timeboxBeginDateDef, DateTime.Now);
assetTimeBox.SetAttributeValue(timeboxStateDef, Oid.FromToken("State:100", MetaModel));
assetTimeBox.SetAttributeValue(timeboxScheduleDef, scheduleOid.Momentless.Token);
Services.Save(assetTimeBox);
return assetTimeBox;
}
示例4: CreateStory
protected Asset CreateStory(string name, string description, Oid scopeOid, Oid featureGroupOid, Oid teamOid, Oid sprintOid)
{
var storyNameDef = MetaModel.GetAttributeDefinition("Story.Name");
var storyScopeDef = MetaModel.GetAttributeDefinition("Story.Scope");
var storyDescDef = MetaModel.GetAttributeDefinition("Story.Description");
var storyParentDef = MetaModel.GetAttributeDefinition("Story.Parent");
var storyTeamDef = MetaModel.GetAttributeDefinition("Story.Team");
var storyTimeBoxDef = MetaModel.GetAttributeDefinition("Story.Timebox");
var assetStory = new Asset(MetaModel.GetAssetType("Story"));
assetStory.SetAttributeValue(storyNameDef, name);
assetStory.SetAttributeValue(storyScopeDef, scopeOid);
assetStory.SetAttributeValue(storyDescDef, description);
if (featureGroupOid != null) {
assetStory.SetAttributeValue(storyParentDef, featureGroupOid.Momentless.Token);
}
if (teamOid != null) {
assetStory.SetAttributeValue(storyTeamDef, teamOid.Momentless.Token);
}
if (sprintOid != null) {
assetStory.SetAttributeValue(storyTimeBoxDef, sprintOid.Momentless.Token);
}
Services.Save(assetStory);
return assetStory;
}
示例5: CreateProject
protected Asset CreateProject(string scopeName, Oid scheduleOid, string parentProjectToken)
{
var scopeNameDef = MetaModel.GetAttributeDefinition("Scope.Name");
var scopeParentIdDef = MetaModel.GetAttributeDefinition("Scope.Parent");
var scopeBeginDateDef = MetaModel.GetAttributeDefinition("Scope.BeginDate");
var scopeScheduleDef = MetaModel.GetAttributeDefinition("Scope.Schedule");
var assetScope = new Asset(MetaModel.GetAssetType("Scope"));
assetScope.SetAttributeValue(scopeNameDef, scopeName);
assetScope.SetAttributeValue(scopeParentIdDef, Oid.FromToken(parentProjectToken, MetaModel));
assetScope.SetAttributeValue(scopeBeginDateDef, DateTime.Now);
if (scheduleOid != null) {
assetScope.SetAttributeValue(scopeScheduleDef, scheduleOid.Momentless.Token);
}
Services.Save(assetScope);
return assetScope;
}
示例6: CreateSchedule
protected Asset CreateSchedule(string name)
{
var scheduleNameDef = MetaModel.GetAttributeDefinition("Schedule.Name");
var scheduleTimeboxGapDef = MetaModel.GetAttributeDefinition("Schedule.TimeboxGap");
var scheduleTimeboxLengthDef = MetaModel.GetAttributeDefinition("Schedule.TimeboxLength");
var assetSchedule = new Asset(MetaModel.GetAssetType("Schedule"));
assetSchedule.SetAttributeValue(scheduleNameDef, name);
assetSchedule.SetAttributeValue(scheduleTimeboxGapDef, "0 Days");
assetSchedule.SetAttributeValue(scheduleTimeboxLengthDef, "14 Days");
Services.Save(assetSchedule);
return assetSchedule;
}
示例7: CreateFeatureGroup
protected Asset CreateFeatureGroup(string name, Oid scopeOid, Oid parentFGroup)
{
var themeNameDef = MetaModel.GetAttributeDefinition("Theme.Name");
var themeScopeDef = MetaModel.GetAttributeDefinition("Theme.Scope");
var themeParentDef = MetaModel.GetAttributeDefinition("Theme.Parent");
var assetFGroup = new Asset(MetaModel.GetAssetType("Theme"));
assetFGroup.SetAttributeValue(themeNameDef, name);
assetFGroup.SetAttributeValue(themeScopeDef, scopeOid);
if (parentFGroup != null) {
assetFGroup.SetAttributeValue(themeParentDef, parentFGroup.Momentless.Token);
}
Services.Save(assetFGroup);
return assetFGroup;
}
示例8: CreateDefect
protected Asset CreateDefect(string name, string description, Oid scopeOid, Oid featureGroupOid, Oid teamOid, Oid sprintOid)
{
var defectNameDef = MetaModel.GetAttributeDefinition("Defect.Name");
var defectScopeDef = MetaModel.GetAttributeDefinition("Defect.Scope");
var defectDescDef = MetaModel.GetAttributeDefinition("Defect.Description");
var defectParentDef = MetaModel.GetAttributeDefinition("Defect.Parent");
var defectTeamDef = MetaModel.GetAttributeDefinition("Defect.Team");
var defectTimeBoxDef = MetaModel.GetAttributeDefinition("Defect.Timebox");
var assetDefect = new Asset(MetaModel.GetAssetType("Defect"));
assetDefect.SetAttributeValue(defectNameDef, name);
assetDefect.SetAttributeValue(defectScopeDef, scopeOid);
assetDefect.SetAttributeValue(defectDescDef, description);
if (featureGroupOid != null) {
assetDefect.SetAttributeValue(defectParentDef, featureGroupOid.Momentless.Token);
}
if (teamOid != null) {
assetDefect.SetAttributeValue(defectTeamDef, teamOid.Momentless.Token);
}
if (sprintOid != null) {
assetDefect.SetAttributeValue(defectTimeBoxDef, sprintOid.Momentless.Token);
}
Services.Save(assetDefect);
return assetDefect;
}
示例9: CreateWorkitemStatus
public ValueId CreateWorkitemStatus(string statusName)
{
try {
var primaryWorkitemStatusType = metaModel.GetAssetType(WorkitemStatusType);
var status = new Asset(primaryWorkitemStatusType);
status.SetAttributeValue(primaryWorkitemStatusType.NameAttribute, statusName);
services.Save(status);
return new ValueId(status.Oid.Momentless, statusName);
} catch (V1Exception ex) {
throw new VersionOneException(queryBuilder.Localize(ex.Message));
} catch(Exception ex) {
throw new VersionOneException(ex.Message);
}
}
示例10: SetAssetAttribute
private static void SetAssetAttribute(Asset asset, string attrName, object value) {
var type = asset.AssetType;
var def = type.GetAttributeDefinition(attrName);
if (value == null || (value is Oid && value.Equals(Oid.Null))) {
asset.EnsureAttribute(def);
} else {
asset.SetAttributeValue(def, value);
}
}
示例11: SaveChangeSetAsset
private Asset SaveChangeSetAsset(Asset changeSet, ChangeSetInfo info, IEnumerable<Oid> primaryworkitems)
{
changeSet.SetAttributeValue(ChangeSetNameDef, string.Format("'{0}' on '{1}'", info.Author, GetFormattedTime(info.ChangeDate)));
changeSet.SetAttributeValue(ChangeSetDescriptionDef, info.Message);
foreach(Oid oid in primaryworkitems)
{
changeSet.AddAttributeValue(ChangeSetPrimaryWorkitemsDef, oid);
}
V1Connection.Data.Save(changeSet, changecomment);
return changeSet;
}