Exemplo n.º 1
0
        public void AddPageCount([Values(70)] int tripId)
        {
            var session = TubsDataService.GetSession();
            var trepo = TubsDataService.GetRepository<Trip>(session);
            var repo = TubsDataService.GetRepository<PageCount>(session);

            var trip = trepo.FindById(tripId);

            var pc = new PageCount();
            pc.FormCount = 1;
            pc.FormName = Common.FormNames.GEN3;
            pc.EnteredBy = @"NOUMEA\coreyc";
            pc.EnteredDate = DateTime.Now;
            pc.Trip = trip;

            using (var xa = session.BeginTransaction())
            {
                repo.Save(pc);
                xa.Commit();
                repo.Reload(pc);
                Assert.NotNull(pc);
                Assert.AreNotEqual(0, pc.Id);
            }
        }
Exemplo n.º 2
0
        public virtual void AddPageCount(PageCount pageCount)
        {
            if (null == pageCount)
                return;

            pageCount.Trip = this;
            this.PageCounts.Add(pageCount);
        }