public ActionResult Index(int?id)
        {
            ViewBag.ActiveMenu = 1;

            SubscriptionV areaModel = new SubscriptionV();

            if (id != null)
            {
                using (SubscriptionRepository vehiclesProxy = new SubscriptionRepository())
                {
                    areaModel = vehiclesProxy.GetById((int)id);
                }

                return(PartialView("_AddSubscription", areaModel));
            }
            else
            {
                if (Request.IsAjaxRequest())
                {
                    return(PartialView("_AddSubscription", areaModel));
                }
                else
                {
                    return(View(areaModel));
                }
            }
        }
Beispiel #2
0
        public OctopusAsyncRepository(IOctopusAsyncClient client, RepositoryScope repositoryScope = null)
        {
            Client                    = client;
            Scope                     = repositoryScope ?? RepositoryScope.Unspecified();
            Accounts                  = new AccountRepository(this);
            ActionTemplates           = new ActionTemplateRepository(this);
            Artifacts                 = new ArtifactRepository(this);
            Backups                   = new BackupRepository(this);
            BuiltInPackageRepository  = new BuiltInPackageRepositoryRepository(this);
            CertificateConfiguration  = new CertificateConfigurationRepository(this);
            Certificates              = new CertificateRepository(this);
            Channels                  = new ChannelRepository(this);
            CommunityActionTemplates  = new CommunityActionTemplateRepository(this);
            Configuration             = new ConfigurationRepository(this);
            DashboardConfigurations   = new DashboardConfigurationRepository(this);
            Dashboards                = new DashboardRepository(this);
            Defects                   = new DefectsRepository(this);
            DeploymentProcesses       = new DeploymentProcessRepository(this);
            Deployments               = new DeploymentRepository(this);
            Environments              = new EnvironmentRepository(this);
            Events                    = new EventRepository(this);
            FeaturesConfiguration     = new FeaturesConfigurationRepository(this);
            Feeds                     = new FeedRepository(this);
            Interruptions             = new InterruptionRepository(this);
            LibraryVariableSets       = new LibraryVariableSetRepository(this);
            Lifecycles                = new LifecyclesRepository(this);
            MachinePolicies           = new MachinePolicyRepository(this);
            MachineRoles              = new MachineRoleRepository(this);
            Machines                  = new MachineRepository(this);
            Migrations                = new MigrationRepository(this);
            OctopusServerNodes        = new OctopusServerNodeRepository(this);
            PerformanceConfiguration  = new PerformanceConfigurationRepository(this);
            PackageMetadataRepository = new PackageMetadataRepository(this);
            ProjectGroups             = new ProjectGroupRepository(this);
            Projects                  = new ProjectRepository(this);
            ProjectTriggers           = new ProjectTriggerRepository(this);
            Proxies                   = new ProxyRepository(this);
            Releases                  = new ReleaseRepository(this);
            RetentionPolicies         = new RetentionPolicyRepository(this);
            Schedulers                = new SchedulerRepository(this);
            ServerStatus              = new ServerStatusRepository(this);
            Spaces                    = new SpaceRepository(this);
            Subscriptions             = new SubscriptionRepository(this);
            TagSets                   = new TagSetRepository(this);
            Tasks                     = new TaskRepository(this);
            Teams                     = new TeamsRepository(this);
            Tenants                   = new TenantRepository(this);
            TenantVariables           = new TenantVariablesRepository(this);
            UserInvites               = new UserInvitesRepository(this);
            UserRoles                 = new UserRolesRepository(this);
            Users                     = new UserRepository(this);
            VariableSets              = new VariableSetRepository(this);
            Workers                   = new WorkerRepository(this);
            WorkerPools               = new WorkerPoolRepository(this);
            ScopedUserRoles           = new ScopedUserRoleRepository(this);
            UserPermissions           = new UserPermissionsRepository(this);

            loadRootResource      = new Lazy <Task <RootResource> >(LoadRootDocumentInner, true);
            loadSpaceRootResource = new Lazy <Task <SpaceRootResource> >(LoadSpaceRootDocumentInner, true);
        }
        public void SaveSubscriptionWithStudentDeclaration()
        {
            //取未征订学生申报
            var studentDeclarations = _appl.GetNotSubscriptionStudentDeclarationJiaoWu("2013-2014-2");
            var teacherDeclarations = _appl.GetNotSubscriptionTeacherDeclarationJiaoWu("2013-2014-2");
            //生成订单
            var subscriptions = SubscriptionService.CreateSubscriptionsByPress(studentDeclarations, teacherDeclarations);
            //保存
            var repo = new SubscriptionRepository(_context);

            for (int i = 0; i < subscriptions.Count(); i = i + 300)
            {
                foreach (var item in subscriptions.Skip(i).Take(300))
                {
                    repo.Add(item);
                }
                repo.Context.Commit();
            }

            var ids    = subscriptions.Select(d => d.ID);
            var result = repo.Find(t => ids
                                   .Contains(t.ID)
                                   );

            Assert.AreEqual(subscriptions.Count(), result.Count());
        }
Beispiel #4
0
 public FeedController(SubscriptionRepository subscriptionRepo,
                       PostRepository postRepo)
 {
     _subscriptionRepo = subscriptionRepo;
     _postRepo         = postRepo;
     model             = new FeedViewModel();
 }
        public SubscriptionRouterService(IServiceBus bus, SubscriptionRepository repository, string network)
        {
            _peerUri = bus.ControlBus.Endpoint.Address.Uri;

            _repository = repository;
            _network = network;

            _peerId = NewId.NextGuid();

            _observers = new List<SubscriptionObserver>();
            _listeners = new List<BusSubscriptionEventListener>();

            _unregister = () => true;

            _peerUri = bus.ControlBus.Endpoint.Address.Uri;

            var connector = new BusSubscriptionConnector(bus);

            _peerCache = ActorFactory.Create<PeerCache>(x =>
                {
                    x.ConstructedBy((fiber, scheduler, inbox) =>
                                    new PeerCache(connector, _peerId, _peerUri, repository));
                    x.UseSharedScheduler();
                    x.HandleOnPoolFiber();
                })
                .GetActor();

            // at this point, existing subscriptions need to be loaded...

            _repository.Load(this);
        }
Beispiel #6
0
        public static SubscriptionRepository GetSubscriptionRepository(IUnitOfWork unitOfWork)
        {
            var repository = new SubscriptionRepository();

            repository.UnitOfWork = unitOfWork;
            return(repository);
        }
Beispiel #7
0
        public void GetSubscription()
        {
            var repo   = new SubscriptionRepository(_context);
            var result = repo.Find(t => t.SchoolYearTerm.Year == "2013-2014" && t.SchoolYearTerm.Term == "2");

            Assert.IsTrue(result.Count() > 0);
        }
        public void When_GetSubscriptionIsCalled_AndSubscriptionIsNotPresent_Then_SubscriptionListIsEmpty()
        {
            var repository = new SubscriptionRepository();

            var subscription1 = new SubscriptionDataModel
            {
                Username    = "******",
                AccessToken = "testtoken",
                TotalNotificationsPushed = 0,
            };

            repository.Add(subscription1);

            var subscription2 = new SubscriptionDataModel
            {
                Username    = "******",
                AccessToken = "newtoken",
                TotalNotificationsPushed = 0,
            };

            repository.Add(subscription2);

            var result = repository.GetSubscription("bbc1");

            // Assert
            Assert.IsNull(result);
        }
        public void When_UpdateIsCalled_AndSubscriptionIsNotPresent_Then_FalseIsReturned()
        {
            var repository = new SubscriptionRepository();

            var subscription1 = new SubscriptionDataModel
            {
                Username    = "******",
                AccessToken = "testtoken",
                TotalNotificationsPushed = 0,
            };

            repository.Add(subscription1);

            var subscription2 = new SubscriptionDataModel
            {
                Username    = "******",
                AccessToken = "newtoken",
                TotalNotificationsPushed = 0,
            };

            repository.Add(subscription2);

            var result = repository.Update(new SubscriptionDataModel {
                AccessToken = "newToken", Username = "******"
            });

            // Assert
            Assert.IsFalse(result);
        }
        public void When_GetSubscriptionIsCalled_AndSubscriptionIsPresent_Then_SubscriptionIsReturned()
        {
            var repository = new SubscriptionRepository();

            var subscription1 = new SubscriptionDataModel
            {
                Username    = "******",
                AccessToken = "testtoken",
                TotalNotificationsPushed = 0,
            };

            repository.Add(subscription1);

            var subscription2 = new SubscriptionDataModel
            {
                Username    = "******",
                AccessToken = "newtoken",
                TotalNotificationsPushed = 0,
            };

            repository.Add(subscription2);

            var result = repository.GetSubscription("bbc");

            // Assert
            Assert.AreEqual(subscription1.Username, result.Username);
            Assert.AreEqual(subscription1.AccessToken, result.AccessToken);
        }
        public static void PreWarm(this IApplicationBuilder applicationBuilder)
        {
            Startup.LoadTypes();

            var internalSubscriptionService = bool.Parse(ConfigurationReader.GetValue("InternalSubscriptionService"));

            if (internalSubscriptionService)
            {
                String eventStoreConnectionString             = ConfigurationReader.GetValue("EventStoreSettings", "ConnectionString");
                Int32  inflightMessages                       = int.Parse(ConfigurationReader.GetValue("AppSettings", "InflightMessages"));
                Int32  persistentSubscriptionPollingInSeconds = int.Parse(ConfigurationReader.GetValue("AppSettings", "PersistentSubscriptionPollingInSeconds"));
                String filter        = ConfigurationReader.GetValue("AppSettings", "InternalSubscriptionServiceFilter");
                String ignore        = ConfigurationReader.GetValue("AppSettings", "InternalSubscriptionServiceIgnore");
                String streamName    = ConfigurationReader.GetValue("AppSettings", "InternalSubscriptionFilterOnStreamName");
                Int32  cacheDuration = int.Parse(ConfigurationReader.GetValue("AppSettings", "InternalSubscriptionServiceCacheDuration"));

                ISubscriptionRepository subscriptionRepository = SubscriptionRepository.Create(eventStoreConnectionString, cacheDuration);

                ((SubscriptionRepository)subscriptionRepository).Trace += (sender,
                                                                           s) => Extensions.log(TraceEventType.Information, "REPOSITORY", s);

                // init our SubscriptionRepository
                subscriptionRepository.PreWarm(CancellationToken.None).Wait();

                var eventHandlerResolver = Startup.ServiceProvider.GetService <IDomainEventHandlerResolver>();

                SubscriptionWorker concurrentSubscriptions =
                    SubscriptionWorker.CreateConcurrentSubscriptionWorker(eventStoreConnectionString,
                                                                          eventHandlerResolver,
                                                                          subscriptionRepository,
                                                                          inflightMessages,
                                                                          persistentSubscriptionPollingInSeconds);

                concurrentSubscriptions.Trace += (_,
                                                  args) => Extensions.concurrentLog(TraceEventType.Information, args.Message);
                concurrentSubscriptions.Warning += (_,
                                                    args) => Extensions.concurrentLog(TraceEventType.Warning, args.Message);
                concurrentSubscriptions.Error += (_,
                                                  args) => Extensions.concurrentLog(TraceEventType.Error, args.Message);

                if (!string.IsNullOrEmpty(ignore))
                {
                    concurrentSubscriptions = concurrentSubscriptions.IgnoreSubscriptions(ignore);
                }

                if (!string.IsNullOrEmpty(filter))
                {
                    //NOTE: Not overly happy with this design, but
                    //the idea is if we supply a filter, this overrides ignore
                    concurrentSubscriptions = concurrentSubscriptions.FilterSubscriptions(filter).IgnoreSubscriptions(null);
                }

                if (!string.IsNullOrEmpty(streamName))
                {
                    concurrentSubscriptions = concurrentSubscriptions.FilterByStreamName(streamName);
                }

                concurrentSubscriptions.StartAsync(CancellationToken.None).Wait();
            }
        }
Beispiel #12
0
        public SubscriptionRouterService(IServiceBus bus, SubscriptionRepository repository, string network)
        {
            _peerUri = bus.ControlBus.Endpoint.Address.Uri;

            _repository = repository;
            _network    = network;

            _peerId = NewId.NextGuid();

            _observers = new List <SubscriptionObserver>();
            _listeners = new List <BusSubscriptionEventListener>();

            _unregister = () => true;

            _peerUri = bus.ControlBus.Endpoint.Address.Uri;

            var connector = new BusSubscriptionConnector(bus);

            _peerCache = ActorFactory.Create <PeerCache>(x =>
            {
                x.ConstructedBy((fiber, scheduler, inbox) =>
                                new PeerCache(connector, _peerId, _peerUri, repository));
                x.UseSharedScheduler();
                x.HandleOnPoolFiber();
            })
                         .GetActor();

            // at this point, existing subscriptions need to be loaded...

            _repository.Load(this);
        }
Beispiel #13
0
 public UnitOfWork(EasyFindPropertiesEntities dbCtx)
 {
     _dbCtx              = dbCtx;
     PropertyType        = new PropertyTypeRepository(_dbCtx);
     AdPriority          = new AdPriorityRepository(_dbCtx);
     AdType              = new AdTypeRepository(_dbCtx);
     PropertyCategory    = new PropertyCategoryRepository(_dbCtx);
     PropertyCondition   = new PropertyConditionRepository(_dbCtx);
     PropertyImage       = new PropertyImageRepository(_dbCtx);
     PropertyPurpose     = new PropertyPurposeRepository(_dbCtx);
     PropertyRating      = new PropertyRatingRepository(_dbCtx);
     Property            = new PropertyRepository(_dbCtx);
     PropertyRequisition = new PropertyRequisitionRepository(_dbCtx);
     SubscriptionType    = new SubscriptionTypeRepository(_dbCtx);
     Subscription        = new SubscriptionRepository(_dbCtx);
     TagType             = new TagTypeRepository(_dbCtx);
     Tennant             = new TennantRepository(_dbCtx);
     Owner          = new OwnerRepository(_dbCtx);
     Tags           = new TagsRepository(_dbCtx);
     Message        = new MessageRepository(_dbCtx);
     User           = new UserRepository(_dbCtx);
     UserType       = new UserTypeRepository(_dbCtx);
     UserTypeAssoc  = new UserTypeAssocRepository(_dbCtx);
     MessageTrash   = new MessageTrashRepository(_dbCtx);
     Meeting        = new MeetingRepository(_dbCtx);
     MeetingMembers = new MeetingMembersRepository(_dbCtx);
 }
 public SubscriptionController()
 {
     _repo = new VetRepository(new FnRDbContext());
     _subRepo = new SubscriptionRepository(new FnRDbContext());
     _userRepo = new UserRepository(new FnRDbContext());
     _productRepo = new ProductRepository(new FnRDbContext());
 }
Beispiel #15
0
 public ProductController(ILogger <ProductController> logger, VitecContext context)
 {
     _logger                 = logger;
     _context                = context;
     _productRepository      = new ProductRepository(_connectionString + "/api/products");
     _subscriptionRepository = new SubscriptionRepository(_connectionString + "/api/subscriptions");
     _priceRepository        = new PriceRepository(_connectionString + "/api/prices");
 }
Beispiel #16
0
        public static void Main()
        {
            var       repo = new SubscriptionRepository();
            ProgramUI ui   = new ProgramUI(repo, new Repository.Console());

            repo.AddInitialContent();
            ui.Run();
        }
Beispiel #17
0
 public CheckStrategy(UserModel user,
                      SubscriptionRepository repo,
                      ISnowForecastClient snowForecastClient)
 {
     _user = user;
     _repo = repo;
     _snowForecastClient = snowForecastClient;
 }
Beispiel #18
0
 private void OnSubscriptionCreating()
 {
     Hub.Default.Subscribe((MessageEventArgs args) =>
     {
         SubscriptionRepository.CreateSubscription(new Subscription(args.Message.Chat.Id,
                                                                    "https://wykop.pl/"));
     });
 }
Beispiel #19
0
 public UnitOfWork(ApplicationDbContext context)
 {
     _context                             = context;
     TraineeRepository                    = new TraineeRepository(context);
     SubscriptionRepository               = new SubscriptionRepository(context);
     TraineeSubscriptionRepository        = new TraineeSubscriptionRepository(context);
     TraineeSubscriptionsDetailRepository = new TraineeSubscriptionsDetailRepository(context);
 }
Beispiel #20
0
 public PaymentsUnitOfWork(PaymentsContext context)
 {
     _context               = context;
     ProductRepository      = new ProductRepository(context);
     PaymentRepository      = new PaymentRepository(context);
     PayPalPlanRepository   = new PayPalPlanRepository(context);
     SubscriptionRepository = new SubscriptionRepository(context);
 }
Beispiel #21
0
        public void GetTeacherDeclarationsInSubscription()
        {
            var repo   = new SubscriptionRepository(_context);
            var id     = "5B9B37F5-E6CA-4783-AC12-2C1AFD1BD414".ConvertToGuid();
            var result = repo.Single(t => t.ID == id);

            Assert.IsTrue(result.TeacherDeclarations.Count > 0);
        }
 public PostController(IConfiguration config)
 {
     _postRepository     = new PostRepository(config);
     _categoryRepository = new CategoryRepository(config);
     _commentRepository  = new CommentRepository(config);
     _postTagRepository  = new PostTagRepository(config);
     _postTagRepo        = new PostTagRepository(config);
     _subRepo            = new SubscriptionRepository(config);
 }
        public async Task <Subscription> GetItems(Verification person)
        {
            var request = new Subscription {
                Email = person.Email
            };
            var repo = new SubscriptionRepository();

            return(await repo.ReadByEmail(request.Email));
        }
        public ActionResult ChangeDone(int uId, bool activeV)
        {
            using (SubscriptionRepository secUserRepo = new SubscriptionRepository())
            {
                secUserRepo.DoneById(uId, activeV);
            }

            return(Json(new { success = reqResponse.IsDone, message = reqResponse.IsDone ? OperationLP.SuccessMsg : reqResponse.ErrorMessegesStr }));
        }
Beispiel #25
0
 public SchedulerController(IMessanger messanger,
                            SnowfallChecker snowfallChecker,
                            UserRepository userRepo,
                            SubscriptionRepository subscriptionRepo)
 {
     _messanger        = messanger;
     _snowfallChecker  = snowfallChecker;
     _userRepo         = userRepo;
     _subscriptionRepo = subscriptionRepo;
 }
        public void When_AddIsCalled_AndSubscriptionIsNull_Then_SubscriptionIsNotAddedAndNullIsReturned()
        {
            SubscriptionDataModel subscription = null;

            var repository = new SubscriptionRepository();
            var result     = repository.Add(subscription);

            // Assert
            Assert.IsNull(result);
        }
 public CourseController(SubscriberRepository subscriberRepository,
                         AuthorRepository authorRepository, CourseRepository courseRepository,
                         SubscriptionRepository subscriptionRepository, SubjectRepository subjectRepository)
 {
     this.authorRepository       = authorRepository;
     this.subscriberRepository   = subscriberRepository;
     this.courseRepository       = courseRepository;
     this.subscriptionRepository = subscriptionRepository;
     this.subjectRepository      = subjectRepository;
 }
 public EndpointSubscriptionCache(SubscriptionObserver observer, Uri peerUri,
     SubscriptionRepository repository)
 {
     _observer = observer;
     _peerUri = peerUri;
     _messageSubscriptions =
         new DictionaryCache<SubscriptionKey, EndpointSubscription>(
             key =>
             new EndpointSubscription(_peerUri, key.MessageName, key.CorrelationId, _observer,
                 repository));
 }
Beispiel #29
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.AddMvc();

            var repository = new SubscriptionRepository();

            services.AddSingleton <ISubscriptionRepository>(repository);
            services.AddTransient <IHttpClientWrapper, HttpClientWrapper>();
            services.AddTransient <INotificationsService, PushBulletNotificationsService>();
        }
 public EndpointSubscriptionCache(SubscriptionObserver observer, Uri peerUri,
                                  SubscriptionRepository repository)
 {
     _observer             = observer;
     _peerUri              = peerUri;
     _messageSubscriptions =
         new DictionaryCache <SubscriptionKey, EndpointSubscription>(
             key =>
             new EndpointSubscription(_peerUri, key.MessageName, key.CorrelationId, _observer,
                                      repository));
 }
Beispiel #31
0
        public void SetUp()
        {
            persistence  = new InMemorySubscriptionPersistence();
            channelGraph = new ChannelGraph {
                Name = TheNodeName
            };
            channelGraph.AddReplyChannel("foo", "foo://replies".ToUri());
            channelGraph.AddReplyChannel("bar", "bar://replies".ToUri());

            theRepository = new SubscriptionRepository(channelGraph, persistence);
        }
Beispiel #32
0
        public PeerCache(SubscriptionObserver observer, Guid clientId, Uri controlUri, SubscriptionRepository repository)
        {
            _peers = new DictionaryCache<Uri, ActorRef>();
            _peerUri = controlUri;
            _peerIds = new DictionaryCache<Guid, Uri>();

            _peerHandlerFactory = ActorFactory.Create((f, s, i) => new PeerHandler(i, observer, repository));

            // create a peer for our local client
            WithPeer(clientId, controlUri, x => { }, true);
        }
Beispiel #33
0
 public HomeController()
 {
     this.CardRepo          = new CardRepository();
     this.CauseRepo         = new CauseRepository();
     this.HelpOptionRepo    = new HelpOptionRepository();
     this.HomePageVideoRepo = new HomePageVideoRepository();
     this.MissionRepo       = new MissionRepository();
     this.WhyUsRepo         = new WhyUsRepository();
     this.ContactRepo       = new ContactRepository();
     this.SubscriptionRepo  = new SubscriptionRepository();
 }
Beispiel #34
0
        public async Task SubscriptionRepository_GetSubscriptions_ReturnsSubscriptions()
        {
            List <PersistentSubscriptionInfo> allSubscriptions = (TestData.GetPersistentSubscriptions_DemoEstate());

            Func <CancellationToken, Task <List <PersistentSubscriptionInfo> > > GetAllSubscriptions = async token => allSubscriptions;

            ISubscriptionRepository subscriptionRepository = SubscriptionRepository.Create(GetAllSubscriptions);

            PersistentSubscriptions list = await subscriptionRepository.GetSubscriptions(true, CancellationToken.None);

            list.PersistentSubscriptionInfo.Count.ShouldBe(allSubscriptions.Count);
        }
        public EndpointSubscription(Uri peerUri, string messageName, string correlationId,
            SubscriptionObserver observer, SubscriptionRepository repository)
        {
            _peerUri = peerUri;
            _messageName = messageName;
            _correlationId = correlationId;
            _observer = observer;
            _repository = repository;

            _ids = new Dictionary<Guid, PeerSubscription>();

            _subscriptionId = Guid.Empty;
        }
Beispiel #36
0
        public PeerHandler(Inbox inbox, SubscriptionObserver observer,
            SubscriptionRepository repository)
        {
            _observer = observer;

            inbox.Receive<InitializePeerHandler>(init =>
                {
                    _peerId = init.PeerId;
                    _peerUri = init.PeerUri;

                    _endpointSubscriptionCache = new EndpointSubscriptionCache(observer, _peerUri,
                        repository);
                });
        }
 public OctopusRepository(IOctopusClient client)
 {
     this.Client = client;
     Feeds = new FeedRepository(client);
     Backups = new BackupRepository(client);
     Machines = new MachineRepository(client);
     MachineRoles = new MachineRoleRepository(client);
     MachinePolicies = new MachinePolicyRepository(client);
     Subscriptions = new SubscriptionRepository(client);
     Environments = new EnvironmentRepository(client);
     Events = new EventRepository(client);
     FeaturesConfiguration = new FeaturesConfigurationRepository(client);
     ProjectGroups = new ProjectGroupRepository(client);
     Projects = new ProjectRepository(client);
     Proxies = new ProxyRepository(client);
     Tasks = new TaskRepository(client);
     Users = new UserRepository(client);
     VariableSets = new VariableSetRepository(client);
     LibraryVariableSets = new LibraryVariableSetRepository(client);
     DeploymentProcesses = new DeploymentProcessRepository(client);
     Releases = new ReleaseRepository(client);
     Deployments = new DeploymentRepository(client);
     Certificates = new CertificateRepository(client);
     Dashboards = new DashboardRepository(client);
     DashboardConfigurations = new DashboardConfigurationRepository(client);
     Artifacts = new ArtifactRepository(client);
     Interruptions = new InterruptionRepository(client);
     ServerStatus = new ServerStatusRepository(client);
     UserRoles = new UserRolesRepository(client);
     Teams = new TeamsRepository(client);
     RetentionPolicies = new RetentionPolicyRepository(client);
     Accounts = new AccountRepository(client);
     Defects = new DefectsRepository(client);
     Lifecycles = new LifecyclesRepository(client);
     OctopusServerNodes = new OctopusServerNodeRepository(client);
     Channels = new ChannelRepository(client);
     ProjectTriggers = new ProjectTriggerRepository(client);
     Schedulers = new SchedulerRepository(client);
     Tenants = new TenantRepository(client);
     TagSets = new TagSetRepository(client);
     BuiltInPackageRepository = new BuiltInPackageRepositoryRepository(client);
     ActionTemplates = new ActionTemplateRepository(client);
     CommunityActionTemplates = new CommunityActionTemplateRepository(client);
 }
 public void GetSubscriptionWithNotSubscription()
 {
     var repo = new SubscriptionRepository(_context);
     var result = repo.Find(t =>
         t.SchoolYearTerm.Year == "2013-2014" &&
         t.SchoolYearTerm.Term == "2" &&
         t.SubscriptionState == FeedbackState.未征订);
     Assert.IsTrue(result.Count() > 0);
 }
 public void GetTeacherDeclarationsInSubscription()
 {
     var repo = new SubscriptionRepository(_context);
     var id = "5B9B37F5-E6CA-4783-AC12-2C1AFD1BD414".ConvertToGuid();
     var result = repo.Single(t => t.ID == id);
     Assert.IsTrue(result.TeacherDeclarations.Count > 0);
 }
        public void SaveSubscriptionWithStudentDeclaration()
        {
            //取未征订学生申报
            var studentDeclarations = _appl.GetNotSubscriptionStudentDeclarationJiaoWu("2013-2014-2");
            var teacherDeclarations = _appl.GetNotSubscriptionTeacherDeclarationJiaoWu("2013-2014-2");
            //生成订单
            var subscriptions = SubscriptionService.CreateSubscriptionsByPress(studentDeclarations, teacherDeclarations);
            //保存
            var repo = new SubscriptionRepository(_context);
            for (int i = 0; i < subscriptions.Count(); i = i + 300)
            {
                foreach (var item in subscriptions.Skip(i).Take(300))
                {
                    repo.Add(item);
                }
                repo.Context.Commit();
            }

            var ids = subscriptions.Select(d => d.ID);
            var result = repo.Find(t => ids
                .Contains(t.ID)
                );
            Assert.AreEqual(subscriptions.Count(), result.Count());
        }