当前位置: 首页>>代码示例>>C#>>正文


C# Company.CreateAndFlush方法代码示例

本文整理汇总了C#中Company.CreateAndFlush方法的典型用法代码示例。如果您正苦于以下问题:C# Company.CreateAndFlush方法的具体用法?C# Company.CreateAndFlush怎么用?C# Company.CreateAndFlush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Company的用法示例。


在下文中一共展示了Company.CreateAndFlush方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddInitialCompanyAndUser

 public void AddInitialCompanyAndUser()
 {
     Assembly assembly = Assembly.Load("StoryVerse.Core");
     ActiveRecordStarter.Initialize(assembly,
         ActiveRecordSectionHandler.Instance);
     Company c = new Company();
     c.Name = "getin";
     Person p = new Person();
     p.FirstName = "Get";
     p.LastName = "In";
     p.Username = "getin";
     p.Password = "letmein";
     p.IsAdmin = true;
     c.AddEmployee(p);
     c.CreateAndFlush();
 }
开发者ID:bertusmagnus,项目名称:Storyverse,代码行数:16,代码来源:Methods.Initialize.cs

示例2: can_save_new_issue

        public void can_save_new_issue()
        {
            Company company = new Company();
            company.Name = "Test Company";
            company.CreateAndFlush();

            Issue issue = new Issue();
            issue.Title = "Test issue";
            issue.Type = IssueType.Defect;

            IssueNote note = new IssueNote();
            note.Body = "Test note";
            issue.AddNote(note);

            IssueChange change = new IssueChange();
            change.PropertyName = "Test change";
            issue.AddChange(change);

            IssueAttachment att = new IssueAttachment();
            att.Body = new byte[10];
            att.Title = "Test attachment";
            issue.AddAttachment(att);

            Project project = new Project();
            project.Company = company;
            project.AddIssue(issue);
            project.Name = "Test project";
            project.CreateAndFlush();

            using (SessionScope newScope = new SessionScope())
            {
                Issue actual = Issue.Find(issue.Id);
                Assert.AreEqual("Test issue", actual.Title);
                Assert.AreEqual("Test note", actual.Notes[0].Body);
                Assert.AreEqual("Test change", actual.Changes[0].PropertyName);
                Assert.AreEqual("Test attachment", actual.Attachments[0].Title);
            }

            project.DeleteAndFlush();
            company.DeleteAndFlush();
        }
开发者ID:bertusmagnus,项目名称:Storyverse,代码行数:41,代码来源:IssueTests.cs

示例3: LoadBaseData

        public static void LoadBaseData()
        {
            UserGroup group = new UserGroup
                              {
                              	Name = "Aggieland .NET User's Group",
                              	ShortName = "AggielandDNUG",
                              	LogoUrl = "../../Content/images/aggielanddnug2.png",
                              	WelcomeMessage =
                              		"<p>Welcome to the website of the Aggieland .NET User's Group</p><p>Our monthly meetings are at noon on the 2nd Tuesday of each month on the Texas A&M University campus.</p>",
                                                    ContactInfo = "<h3>Stay in touch with the DNUG</h3><ul><li>Join the mailing list<ul><li><a href=\"mailto://[email protected]?body=subscribe%20dotnet\">by email</a></li><li><a href=\"https://listserv.tamu.edu/cgi-bin/wa?SUBED1=dotnet&A=1\">by web</a></li></ul></li><li>Follow us on <a href=\"http://twitter.com/aggielanddnug\">twitter</a></li><li>Join the <a href=\"http://www.facebook.com/groups.php?ref=sb#/group.php?gid=43083919957\">facebook group</a></li></ul>"
                              };
            group.CreateAndFlush();

            Company improving = new Company
                                {
                                    Name = "Improving Enterprises",
                                    Url = "http://improvingenterprises.com",
                                    LogoUrl = "../../Content/images/improving200.png",
                                    HomePage = true
                                };
            improving.CreateAndFlush(group);

            Company microsoft = new Company
            {
                Name = "Microsoft",
                Url = "http://www.microsoft.com",
                LogoUrl = "../../Content/images/microsoft.jpg",
                HomePage = true
            };
            microsoft.CreateAndFlush(group);
            Company tamu = new Company
            {
                Name = "Texas A&M University",
                Url = "http://www.tamu.edu",
                LogoUrl = "../../Content/images/primaryWhiteMaroon.jpg",
                HomePage = true
            };
            tamu.CreateAndFlush(group);
            new Company
            {
                Name = "INETA",
                Url = "http://www.ineta.org",
                LogoUrl = "http://www.ineta.org/OfficialLogo.ashx?ugid=1",
                HomePage = true
            }.CreateAndFlush(group);
            new Company
            {Name = "O'Reilly", Url = "http://www.oreilly.com", LogoUrl = "../../Content/images/oreilly.gif", HomePage = true}.
                CreateAndFlush(group);
            new Company
            {
                Name = "DevExpress",
                Url = "http://www.devexpress.com",
                LogoUrl = "../../Content/images/devexpress.png",
                HomePage = true
            }.CreateAndFlush(group);

            new Person {Name = "Allen Hurst", Company = improving, BlogUrl = "http://ahurst.com"}.CreateAndFlush(group);
            new Person {Name = "Mike Abney", Company = improving, BlogUrl = "http://practicallyagile.com"}.CreateAndFlush(group);
            new Person {Name = "Dan Cary", Company = tamu}.CreateAndFlush(group);
            new Person {Name = "Robert Stackhouse", Company = tamu, BlogUrl = "http://robertstackhouse.com"}.CreateAndFlush(group);
            Person eric = new Person {Name = "Eric Huckabay", Company = improving};
            eric.CreateAndFlush(group);

            Venue gsc = new Venue{Name = "TAMU GSC"};
            gsc.CreateAndFlush(group);

            new SpecialContent
            {
                HomePage = true,
                Content =
                    "<a href=\"http://www.oreilly.com/store/\"><img src=\"../../Content/images/oreillydiscount.gif\" alt=\"O'Reilly User Group Discount\"/></a>"
            }.CreateAndFlush(group);
            // Add special content for o'reilly user group
            // add special content for twitter feed

            // Add people with blog links

            new Event
            {
                Date = new DateTime(2009, 04, 14, 12, 0, 0),
                Name = "April Meeting: Shoving Your Code Where It Belongs",
                Speakers = new[] {eric},
                Summary =
                    "Come join us for our April meeting. Mike will be covering career growth and how you can be better prepared for getting your next job, promotion, or raise. There will be door prizes provided by Microsoft and pizza provided by Improving Enterprises. Please RSVP if you plan to attend (up to 2 hours before the event) so that we don't have (another) pizza shortage!",
                Sponsors = new[] {improving, microsoft},
                EventLink1Text = "Via Facebook",
                EventLink1Url = "http://www.facebook.com/editevent.php?picture&eid=73126954537&created&new&m=1#/event.php?eid=73126954537",
                EventLink2Text = "Via Codezone",
                EventLink2Url = "https://www.ugss.codezone.com/PrivilegedUGEventView.CodezoneCom?EventID=6726",
                Venue = gsc
            }.CreateAndFlush(group);

            new Event
            {
                Date = new DateTime(2009, 05, 12, 12, 0, 0),
                Name = "May Meeting: Developing Your Development Career",
                Speakers = new[] {eric},
                Summary =
                    "Come join us for our May meeting. Eric will be covering career growth and how you can be better prepared for getting your next job, promotion, or raise. There will be door prizes provided by Microsoft and pizza provided by Improving Enterprises. Please RSVP if you plan to attend (up to 2 hours before the event) so that we don't have (another) pizza shortage!",
                Sponsors = new[] {improving, microsoft},
//.........这里部分代码省略.........
开发者ID:akhurst,项目名称:usergroupcms,代码行数:101,代码来源:UtilityController.cs


注:本文中的Company.CreateAndFlush方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。