本文整理汇总了C#中Story.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Story.Save方法的具体用法?C# Story.Save怎么用?C# Story.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Story
的用法示例。
在下文中一共展示了Story.Save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAssets
public void CreateAssets() {
if (sandboxProject == null) {
sandboxProject = SandboxProject;
andre = Instance.Get.MemberByID("Member:1000");
danny = Instance.Get.MemberByID("Member:1005");
epic1 = Instance.Create.Epic("Epic 1", SandboxProject);
epic2 = epic1.GenerateChildEpic();
epic2.Name = "Epic 2";
epic2.Save();
story1 = SandboxProject.CreateStory("Story 1");
story2 = SandboxProject.CreateStory("Story 2");
story3 = SandboxProject.CreateStory("Story 3");
defect1 = SandboxProject.CreateDefect("Defect 1");
defect2 = SandboxProject.CreateDefect("Defect 2");
defect3 = SandboxProject.CreateDefect("Defect 3");
story1.Description = "ABCDEFGHIJKJMNOPQRSTUVWXYZ";
story1.Save();
story2.Description = "1234567890";
story2.Save();
story3.Description = "123 ABC";
story3.Save();
story1.Owners.Add(andre);
story1.Owners.Add(danny);
story3.Owners.Add(andre);
defect2.Owners.Add(andre);
defect3.Owners.Add(danny);
defect1.FoundInBuild = "1.0.0.0";
defect1.ResolvedInBuild = "1.0.0.2";
defect1.Environment = "Windows";
defect1.Estimate = 2.0;
defect1.Reference = "123456";
defect1.Save();
defect2.AffectedByDefects.Add(defect1);
defect2.FoundInBuild = "1.0.0.0";
defect2.FoundBy = "Joe";
defect2.VerifiedBy = andre;
defect2.Environment = "Mac";
defect2.Type.CurrentValue = "Documentation";
defect2.ResolutionReason.CurrentValue = "Duplicate";
defect2.Estimate = 1.0;
defect2.Save();
defect3.FoundInBuild = "1.0.0.1";
defect3.FoundBy = "Bob";
defect3.VerifiedBy = danny;
defect3.Type.CurrentValue = "Code";
defect3.ResolutionReason.CurrentValue = "Fixed";
defect3.Save();
}
}
开发者ID:bigjonroberts,项目名称:VersionOne.SDK.NET.ObjectModel,代码行数:57,代码来源:PrimaryWorkitemFilterTesterBase.cs
示例2: Add_Story
protected void Add_Story()
{
//make a new story object
Story story = new Story();
//set story's Title property to value from txtTitle
story.Title = this.txtTitle.Value;
//set story's Summary property to value from txtSummary
story.Summary = this.txtSummary.Value;
//set story's FandomID property to selected value of ddlFandom
story.FandomID = new Guid(this.ddlFandom.SelectedValue);
//set story's GenreID1 property to selected value of ddlGenre1
story.GenreID1 = new Guid(this.ddlGenre1.SelectedValue);
//set story's GenreID2 property to selected value of ddlGenre2
story.GenreID2 = new Guid(this.ddlGenre2.SelectedValue);
//set story's MaturityID property to selected value of ddlMaturityID
story.MaturityID = new Guid(this.ddlMaturity.SelectedValue);
//set stryUser UserID to the User's ID (stored in session)
usersStories.UserID = userID;
//if statement will run if story.IsSavable equals true
if (story.IsSavable() == true)
{
//if the story is savable, save it
story = story.Save();
//set the storyID of stryUsers to the id of story
usersStories.StoryID = story.Id;
//make a new User called usr
User usr = new User();
//get the right user by userID (taken from Session["UserID"])
usr = usr.GetById(userID);
//set usr's StoryAmount property to equal itself plus 1
usr.StoryAmount = usr.StoryAmount + 1;
//set usersStories' UserId property to value of userID
usersStories.UserID = userID;
//call save_Bridges
save_Bridges();
//redirect user to AddChapter page
Server.Transfer("AddChapter.aspx", true);
}
}