static void Main(string[] args)
        {
            var repository            = new MachineRepository("172.16.28.250", "RALSystem", "1234", TimeSpan.FromSeconds(20), "TRMI_RAL_System");
            var MachinesToSubscribeTo = new List <MachineKey>()
            {
                new MachineKey("E-6-5", "Press"),
                new MachineKey("E-6-6", "Press"),
                new MachineKey("E-7-3", "Press"),
                new MachineKey("F-2-1", "Press"),
                new MachineKey("F-3-3", "Press"),
                new MachineKey("F-4-5", "Press"),
                new MachineKey("F-4-6", "Press"),
                new MachineKey("F-4-7", "Press"),
                new MachineKey("F-6-2", "Press"),
                new MachineKey("F-6-4", "Press"),
                new MachineKey("F-7-2", "Press"),
                new MachineKey("F-7-3", "Press"),
                new MachineKey("G-4-1", "Press"),
                new MachineKey("G-4-2", "Press"),
                new MachineKey("F-2-2", "Press"),
                new MachineKey("F-3-1", "Press"),
                new MachineKey("F-6-3", "Press"),
                new MachineKey("G-6-1", "Press"),
                new MachineKey("G-6-2", "Press"),
            };
            var fetcher = new StatusFetcher(repository: repository, TimeSpan.FromMilliseconds(1000), MachinesToSubscribeTo);

            fetcher.OnStatusesUpdated += (sender, eventArgs) => { WriteStatuses(fetcher.MachineStatuses.Items); };
            fetcher.Start();

            System.Console.ReadKey();
        }
Example #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);
        }
Example #3
0
        protected override async Task OnInitializedAsync()
        {
            var machineSet = await MachineRepository.GetMachinesPageAsync(pager.PageIndex, pager.PageSize);

            pager.RecordCount = machineSet.TotalRecords;
            _machines         = machineSet.Records.ToList();
        }
Example #4
0
        protected CrudRepositoryTests <CNCLibContext, MachineEntity, int, IMachineRepository> CreateTestContext()
        {
            return(new CrudRepositoryTests <CNCLibContext, MachineEntity, int, IMachineRepository>()
            {
                CreateTestDbContext = () =>
                {
                    var context = TestFixture.CreateDbContext();
                    var uow = new UnitOfWork <CNCLibContext>(context);
                    var rep = new MachineRepository(context);
                    return new CrudTestDbContext <CNCLibContext, MachineEntity, int, IMachineRepository>(context, uow, rep);
                },
                GetEntityKey = (entity) => entity.MachineId,
                SetEntityKey = (entity, key) =>
                {
                    entity.MachineId = key;
                    foreach (var mc in entity.MachineCommands)
                    {
                        mc.MachineId = key;
                    }

                    foreach (var mic in entity.MachineInitCommands)
                    {
                        mic.MachineId = key;
                    }
                },
                CompareEntity = (entity1, entity2) => entity1.ArePropertiesEqual(entity2, new[] { @"MachineId", @"MachineCommandId", @"MachineInitCommandId", @"User" })
            });
        }
Example #5
0
 private void frmMachine_Load(object sender, EventArgs e)
 {
     _machineRepository = new MachineRepository(_projectDataContext);
     LanguageTranslate.ChangeLanguageForm(this);
     LanguageTranslate.ChangeLanguageGridView(viewDuLieu);
     Search();
 }
Example #6
0
 private void Search()
 {
     _projectDataContext  = new ProjectDataContext();
     _machineRepository   = new MachineRepository(_projectDataContext);
     dgvDuLieu.DataSource = _machineRepository.GetAll().OrderBy(_ => _.MachineNo);
     Control();
 }
        public void A_ChangedMachine_modifies_Existing_Machine_in_the_database()
        {
            var bootStrapper = new BootStrapper();
            bootStrapper.StartServices();
            var serviceEvents = bootStrapper.GetService<IServiceEvents>();
            //1.- Create message
            var aggr = GenerateRandomAggregate();

            //2.- Create the tuple in the database
            var repository = new MachineRepository(_configuration.TestServer);
            repository.Insert(aggr);

            //3.- Change the aggregate
            aggr.DescriptionKeyId = StringExtension.RandomString(10);
            aggr.MachineGroup.SapCode = StringExtension.RandomString(10);
            aggr.MachinePrinter.First().Function = new Random().Next();

            //4.- Emit message
            var message = GenerateMessage(aggr);
            message.MessageType = typeof(ChangedMachine).Name;
            serviceEvents.AddIncommingEvent(new IncommingEvent { @event = message });

            //5.- Load the saved country
            var service = repository.Get(aggr.Id);
            //6.- Check equality
            Assert.True(ObjectExtension.AreEqual(aggr, service));
        }
        public void GetDataForTimeRangeReportAsync()
        {
            var ShiftStart = (Hours : 07, Minutes : 00);
            var ShiftEnd   = (Hours : 15, Minutes : 00);

            var StartDateTime = DateTime.Now.Date.AddHours(ShiftStart.Hours).AddMinutes(ShiftStart.Minutes);

            var EndDateTime = DateTime.Now.Date.AddHours(ShiftEnd.Hours).AddMinutes(ShiftEnd.Minutes);


            var TestDB = $"{nameof(IsRunningRepoTests)}.{nameof(GetDataForTimeRangeReportAsync)}";

            var testDepartment = "TestDepartment";

            var repo = new MachineRepository("192.168.1.208", "TestRunner", "1234", TimeSpan.FromMilliseconds(5000), databaseName: TestDB);

            if (repo.DoesDBExist(TestDB))
            {
                repo.DropDB(TestDB);
            }

            repo.CreateDB(TestDB);


            try
            {
                var listOfMachines = new (string Line, string Name)[]
Example #9
0
        private void frmScanBarcode_Load(object sender, EventArgs e)
        {
            _projectDataContext      = new ProjectDataContext();
            _scanBarcodeRepository   = new ScanBarcodeRepository(_projectDataContext);
            _registBarcodeRepository = new RegistBarcodeRepository(_projectDataContext);
            _partNumberRepository    = new PartNumberRepository(_projectDataContext);
            _machineRepository       = new MachineRepository(_projectDataContext);
            _moldRepository          = new MoldRepository(_projectDataContext);
            _shiftRepository         = new ShiftRepository(_projectDataContext);
            LanguageTranslate.ChangeLanguageForm(this);

            LoadCount();
            LoadPartNumberData();
            LoadMachineData();
            LoadMoldData();

            _serialPort = new SerialPort();
            _serialPort.DataReceived += new SerialDataReceivedEventHandler(this.serialPort_DataReceived);
            Control.CheckForIllegalCrossThreadCalls = false;
            ClosePortCOM(GlobalConstants.portCOM);
            OpenPortCOM(GlobalConstants.portCOM, 9600);

            timer.Enabled = true;
            txtBarcode.Focus();
        }
Example #10
0
        private static async Task RunTestWithLoadedConfig(ILogger sublogger, string ConfigDir)
        {
            Version       v            = Assembly.GetExecutingAssembly().GetName().Version;
            DirectoryInfo appDir       = Directory.GetParent(Assembly.GetEntryAssembly().Location);
            DirectoryInfo appParentDir = new DirectoryInfo(appDir.Parent.FullName);
            DirectoryInfo appLogDir    = new DirectoryInfo($"{appParentDir.FullName}{Path.DirectorySeparatorChar}logs");


            string rootPath             = ConfigDir; //$"{Environment.GetFolderPath(Environment.SpecialFolder.Desktop)}{Path.DirectorySeparatorChar}";
            string repositoryConfigPath = $"{rootPath}{Path.DirectorySeparatorChar}repository.xml.config";
            string reportsConfigPath    = $"{rootPath}{Path.DirectorySeparatorChar}reports.xml.config";


            var configMananger = new RepositoryFactory().LoadFrom(repositoryConfigPath);

            var influxServerAddress = new Uri($"http://{configMananger.Config.DatabaseIPaddress}:{configMananger.Config.DatabasePort}");

            var repo = new MachineRepository(configMananger.Config.DatabaseIPaddress, databaseName: configMananger.Config.DatabaseName, port: Convert.ToInt32(configMananger.Config.DatabasePort));

            if (!repo.CanConnect())
            {
                sublogger.Fatal("Can't Connect to DB Server. Exiting...");
                return;
            }


            var reports = new ReportFactory().LoadFromFile(reportsConfigPath).WithRepository(new RepositoryForReports(repo)).WithLogger(sublogger).Build();

            var registry = new Registry();

            foreach (var report in reports)
            {
                registry.Schedule(() => report.Execute()).ToRunEvery(0).Days().At(report.EndTime.Hours, report.EndTime.Minutes + 1);
            }
        }
Example #11
0
        public Makine1()
        {
            InitializeComponent();
            AycemEntities aycemEntities = new AycemEntities();
            var           result        = MachineRepository.GetMachine();

            dataGridView1.DataSource = result;
        }
Example #12
0
 public PanneController(PoulinaDbContext context, IGenericRepository <Panne> repository, IMediator mediator, MachineRepository machinerepository, IMapper mapper)
 {
     this.mediator          = mediator;
     this.GenericRepository = repository;
     _context           = context;
     _machineRepository = machinerepository;
     this.mapper        = mapper;
 }
        public UnitOfWork(string connectionString)
        {
            var configBuilder = new DbContextOptionsBuilder <DysonSphereAssemblerContext>().UseSqlServer(connectionString);

            _context   = new DysonSphereAssemblerContext(configBuilder.Options);
            Recipes    = new RecipeRepository(_context);
            Components = new ComponentRepository(_context);
            Machines   = new MachineRepository(_context);
        }
        public async Task <IEnumerable <Machine> > Get()
        {
            using (IDbConnection conn = new SqlConnection(config["Data:SqlConnection"]))
            {
                var repo = new MachineRepository(conn);

                return(await repo.GetMachines());
            }
        }
Example #15
0
 public MachineService(MachineRepository machineRepository,
                       MachineContainerRepository machineContainerRepository,
                       UserRepository userRepository, ReceiptRepository receiptRepository)
 {
     _machineRepository          = machineRepository;
     _machineContainerRepository = machineContainerRepository;
     _userRepository             = userRepository;
     _receiptRepository          = receiptRepository;
 }
        public async Task <Machine> Get(int id)
        {
            using (IDbConnection conn = new SqlConnection(config["Data:SqlConnection"]))
            {
                var repo = new MachineRepository(conn);

                return(await repo.GetMachine(id));
            }
        }
        private static async Task RunTestWithLoadedConfig(ILogger sublogger, string ConfigDir)
        {
            Version       v            = Assembly.GetExecutingAssembly().GetName().Version;
            DirectoryInfo appDir       = Directory.GetParent(Assembly.GetEntryAssembly().Location);
            DirectoryInfo appParentDir = new DirectoryInfo(appDir.Parent.FullName);
            DirectoryInfo appLogDir    = new DirectoryInfo($"{appParentDir.FullName}{Path.DirectorySeparatorChar}logs");


            string rootPath                 = ConfigDir; //$"{Environment.GetFolderPath(Environment.SpecialFolder.Desktop)}{Path.DirectorySeparatorChar}";
            string repositoryConfigPath     = $"{rootPath}{Path.DirectorySeparatorChar}repository.xml.config";
            string machineSubscriptionsPath = $"{rootPath}{Path.DirectorySeparatorChar}machines.xml.config";


            var configMananger = new RepositoryFactory().LoadFrom(repositoryConfigPath);

            var influxServerAddress = new Uri($"http://{configMananger.Config.DatabaseIPaddress}:{configMananger.Config.DatabasePort}");

            var ping = new Ping();

            var reply = ping.Send(influxServerAddress.Host);

            if (reply.Status != IPStatus.Success)
            {
                sublogger.Fatal("Ping to Database Server Failed. Exiting...");
                return;
            }

            var repo = new MachineRepository(configMananger.Config.DatabaseIPaddress, databaseName: configMananger.Config.DatabaseName, port: Convert.ToInt32(configMananger.Config.DatabasePort));

            if (!repo.CanConnect())
            {
                sublogger.Fatal("Can't Connect to DB Server. Exiting...");
                return;
            }

            var _pressWriterInflux = new RepositoryWriterPressInflux(repo, sublogger);

            var _messageProcessor = new MessageProcessor(sublogger);

            var machines = new CollectorManagerFactory().LoadFromFile(machineSubscriptionsPath).WithRepoWriter(_pressWriterInflux).WithLogger(sublogger).Build();

            var topicHandlers = new TopicHandlerFactory().AddMachines(machines).Build();

            _messageProcessor.AddMachineTopicHandlers(topicHandlers);

            var _collector = new MQTTCollector(_messageProcessor, sublogger);

            Console.WriteLine("Starting Collection");

            _collector.Start();

            _messageProcessor.StartProcessing();

            Console.WriteLine("Waiting indefinitely");
            await _collector.WaitUntilStoppedAsync();
        }
Example #18
0
 public ReceiptService(PurchaseService purchaseService, EatRepository eatRepository, UserRepository userRepository, MachineContainerRepository machineContainerRepository, MachineRepository machineRepository, ReceiptRepository receiptRepository, UserService userService)
 {
     _purchaseService            = purchaseService;
     _eatRepository              = eatRepository;
     _userRepository             = userRepository;
     _machineContainerRepository = machineContainerRepository;
     _machineRepository          = machineRepository;
     _receiptRepository          = receiptRepository;
     _userService = userService;
 }
Example #19
0
        public static async Task <bool> deleteMachine(String id)
        {
            // TODO Do all heavy Processing Here

            ObjectId machineId = ObjectId.Parse(id);

            var delete = await MachineRepository.deleteMachine(machineId);

            return(true);
        }
        public JsonResult MachineListe()
        {
            //var sessionId = Convert.ToInt32(Session["UserID"]);

            List <MachineModels> messages = new List <MachineModels>();
            MachineRepository    r        = new MachineRepository();

            messages = r.MachineList();

            return(Json(messages, JsonRequestBehavior.AllowGet));
        }
Example #21
0
 protected override void OnStop()
 {
     if (this.MessagesList.Count > 0)
     {
         var rep = new MachineRepository();
         foreach (var client in this.MessagesList)
         {
             rep.Insert(client);
         }
     }
 }
        public static async Task BreakMachine([ActivityTrigger] Machine machine, ILogger log)
        {
            using (IDbConnection conn = new SqlConnection(Environment.GetEnvironmentVariable("SqlConnection")))
            {
                var repo = new MachineRepository(conn);

                machine.Broken = true;

                repo.UpdateMachine(machine);
            }
        }
Example #23
0
        public MachineLayoutViewModel()
        {
            var repository = new MachineRepository("172.26.28.250", "RALSystem", "1234", TimeSpan.FromSeconds(20));

            var MachinesToSubscribeTo = new List <MachineKey>()
            {
                new MachineKey("F-7-3", "Press"), new MachineKey("F-4-5", "Press")
            };

            statusFetcher = new StatusFetcher(repository: repository, TimeSpan.FromMilliseconds(1000), MachinesToSubscribeTo);
        }
Example #24
0
        public static async Task Run([TimerTrigger("0 0 */1 * * *")] TimerInfo myTimer, ILogger log)
        {
            using (IDbConnection conn = new SqlConnection(Environment.GetEnvironmentVariable("SqlConnection")))
            {
                var machineRepo = new MachineRepository(conn);
                var orderRepo   = new OrderRepository(conn);

                await machineRepo.CleanOldData();

                await orderRepo.CleanOldData();
            }
        }
Example #25
0
        public void AsyncGetTasksReturnsAllPages()
        {
            var machine = new MachineResource {
                Links = new LinkCollection {
                    { "TasksTemplate", $"{TestRootPath}api/machines/Machines-1/tasks{{?skip}}" }
                }
            };
            var repository = new MachineRepository(AsyncClient);
            var tasks      = repository.GetTasks(machine).Result;

            Assert.That(tasks.Count, Is.EqualTo(139));
        }
Example #26
0
        public async void VerificarcaoDeSeguraca()
        {
            lbStatus.Text = "Carregando Configurações...";
            lbStatus.Refresh();
            string machineCode = string.Empty;

            try
            {
                //Pegar os dados da maquina
                IMachine iMachine = new MachineRepository();
                machineCode = iMachine.GetMachineIdLocal();
                //Update na estação
                var machineUpdate = await iMachine.GetMachineId(machineCode);

                if (machineUpdate != null)
                {
                    machineUpdate.status_mach     = true;
                    machineUpdate.dtult_vald_mach = DateTime.Now;
                    _ = iMachine.UpdateMachine(machineUpdate, machineCode);
                }
                //Carregar Entidade
                machine = await iMachine.AutenticateMachine(machineCode);
            }
            catch
            {
                //caso na tenha interent ou tenha algum problema na api retrona null
                machine = null;
            }
            if (machine != null)
            {
                if (machineCode != machine.chave_mach)
                {
                    //Sistema bloqueado
                    Limberado = 3;
                    Close(); return;
                }
                else if (DateTime.Now.Date < machine.dtult_vald_mach || DateTime.Now.Date > machine.dprox_vald_mach)
                {
                    //Sistema Esta com a data Vencinda
                    Limberado = 1;
                    Close(); return;
                }
            }
            else
            {
                // 1 - aqui é o problema se não tiver internte como vai ficar?
                // 2 - iMachine.GetMachineIdLocal() sempre pegar da maquina atual como vai ser tratado isso?
                return;
            }
            //se tudo der certo libera
            Limberado = 2;
            Close();
        }
Example #27
0
        // Pager 버튼 클릭 콜백 메서드
        private async void PageIndexChanged(int pageIndex)
        {
            pager.PageIndex  = pageIndex;
            pager.PageNumber = pageIndex + 1;

            var machineSet = await MachineRepository.GetMachinesPageAsync(pager.PageIndex, pager.PageSize);

            pager.RecordCount = machineSet.TotalRecords;     // 총 레코드 수
            _machines         = machineSet.Records.ToList(); // 페이징 처리된 레코드

            StateHasChanged();                               // 현재 컴포넌트 재로드(Pager Refresh)
        }
        public OctopusAsyncRepository(IOctopusAsyncClient client)
        {
            this.Client = client;

            Accounts                 = new AccountRepository(client);
            ActionTemplates          = new ActionTemplateRepository(client);
            Artifacts                = new ArtifactRepository(client);
            Backups                  = new BackupRepository(client);
            BuiltInPackageRepository = new BuiltInPackageRepositoryRepository(client);
            CertificateConfiguration = new CertificateConfigurationRepository(client);
            Certificates             = new CertificateRepository(client);
            Channels                 = new ChannelRepository(client);
            CommunityActionTemplates = new CommunityActionTemplateRepository(client);
            Configuration            = new ConfigurationRepository(client);
            DashboardConfigurations  = new DashboardConfigurationRepository(client);
            Dashboards               = new DashboardRepository(client);
            Defects                  = new DefectsRepository(client);
            DeploymentProcesses      = new DeploymentProcessRepository(client);
            Deployments              = new DeploymentRepository(client);
            Environments             = new EnvironmentRepository(client);
            Events = new EventRepository(client);
            FeaturesConfiguration = new FeaturesConfigurationRepository(client);
            Feeds                    = new FeedRepository(client);
            Interruptions            = new InterruptionRepository(client);
            LibraryVariableSets      = new LibraryVariableSetRepository(client);
            Lifecycles               = new LifecyclesRepository(client);
            MachinePolicies          = new MachinePolicyRepository(client);
            MachineRoles             = new MachineRoleRepository(client);
            Machines                 = new MachineRepository(client);
            Migrations               = new MigrationRepository(client);
            OctopusServerNodes       = new OctopusServerNodeRepository(client);
            PerformanceConfiguration = new PerformanceConfigurationRepository(client);
            ProjectGroups            = new ProjectGroupRepository(client);
            Projects                 = new ProjectRepository(client);
            ProjectTriggers          = new ProjectTriggerRepository(client);
            Proxies                  = new ProxyRepository(client);
            Releases                 = new ReleaseRepository(client);
            RetentionPolicies        = new RetentionPolicyRepository(client);
            Schedulers               = new SchedulerRepository(client);
            ServerStatus             = new ServerStatusRepository(client);
            Subscriptions            = new SubscriptionRepository(client);
            TagSets                  = new TagSetRepository(client);
            Tasks                    = new TaskRepository(client);
            Teams                    = new TeamsRepository(client);
            Tenants                  = new TenantRepository(client);
            TenantVariables          = new TenantVariablesRepository(client);
            UserRoles                = new UserRolesRepository(client);
            Users                    = new UserRepository(client);
            VariableSets             = new VariableSetRepository(client);
            Workers                  = new WorkerRepository(client);
            WorkerPools              = new WorkerPoolRepository(client);
        }
Example #29
0
        private void button1_Click(object sender, EventArgs e)
        {
            var machineName        = textBox1.Text;
            var productionCapacity = textBox2.Text.ToString();
            var productionFail     = textBox3.Text.ToString();
            var result             = MachineRepository.CreateMachine(machineName, Int32.Parse(productionCapacity), Int32.Parse(productionFail));

            if (result)
            {
                MessageBox.Show("Kullanıcı başarıyla eklendi.");
                this.Close();
            }
        }
 public DataAccsessAction(ApplicationDbContext context)
 {
     _context     = context;
     Machines     = new MachineRepository(_context);
     Addresses    = new AddressRepository(_context);
     LaundryUsers = new LaundryUserRepository(_context);
     UserAdmins   = new UserAdminRepository(_context);
     SystemAdmins = new SystemAdminRepository(_context);
     BookingList  = new BookingListRepository(_context);
     LaundryLogs  = new LaundryLogRepository(_context);
     ReservedList = new ReservedListModelRepository(_context);
     MessageList  = new MessageToUserAdminRepository(_context);
 }
Example #31
0
 public UnitOfWork(QualityContext context)
 {
     _context                 = context;
     AnomalyRepository        = new AnomalyRepository(_context);
     MachineRepository        = new MachineRepository(_context);
     ProductTypeRepository    = new ProductTypeRepository(_context);
     ProductCodeRepository    = new ProductCodeRepository(_context);
     CQRepository             = new CQRepository(_context);
     PieceTypeRepository      = new PieceTypeRepository(_context);
     UnitRepository           = new UnitRepository(_context);
     TicketNCRepository       = new TicketNCRepository(_context);
     ProductionAreaRepository = new ProductionAreaRepository(_context);
 }
 public void A_RegisteredMachine_creates_a_new_Machine_in_the_database()
 {
     var bootStrapper = new BootStrapper();
     bootStrapper.StartServices();
     var serviceEvents = bootStrapper.GetService<IServiceEvents>();
     //1.- Create message
     var aggr = GenerateRandomAggregate();
     var message = GenerateMessage(aggr);
     //2.- Emit message
     serviceEvents.AddIncommingEvent(new IncommingEvent { @event = message });
     //3.- Load the saved country
     var repository = new MachineRepository(_configuration.TestServer);
     var service = repository.Get(aggr.Id);
     //4.- Check equality
     Assert.True(ObjectExtension.AreEqual(aggr, service));
 }
 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 A_UnregisteredMachine_removes_Existing_machine_in_the_database()
        {
            var bootStrapper = new BootStrapper();
            bootStrapper.StartServices();
            var serviceEvents = bootStrapper.GetService<IServiceEvents>();
            //1.- Create message
            var aggr = GenerateRandomAggregate();

            //2.- Create the tuple in the database
            var repository = new MachineRepository(_configuration.TestServer);
            repository.Insert(aggr);

            //2.- Emit message
            var message = GenerateMessage(aggr);
            message.MessageType = typeof(UnregisteredMachine).Name;
            serviceEvents.AddIncommingEvent(new IncommingEvent { @event = message });

            var service = repository.Get(aggr.Id);
            Assert.Null(service);
        }