public WorkplacesController()
 {
     _engineService         = new WorkplaceService();
     FormConstructProvider  = new WorkplacesConstructs();
     TableConstructProvider = new WorkplacesConstructs();
 }
예제 #2
0
        private void RegisterServices()
        {
            serverService = new ServerService(AppSettings.Endpoint);
            workplaceService = new WorkplaceService(AppSettings.Endpoint);
            queuePlanService = new QueuePlanService(AppSettings.Endpoint);

            UnityContainer.RegisterInstance(serverService)
                            .RegisterInstance(workplaceService)
                            .RegisterInstance(queuePlanService);
        }
예제 #3
0
파일: Program.cs 프로젝트: breslavsky/queue
        private static void RegisterServices()
        {
            serverService = new ServerService(endpoint);
            container.RegisterInstance(serverService);
            container.RegisterType<ChannelManager<IServerTcpService>>
                (new InjectionFactory(c => serverService.CreateChannelManager(sessionId)));

            userService = new UserService(endpoint);
            container.RegisterInstance(userService);
            container.RegisterType<ChannelManager<IUserTcpService>>
                (new InjectionFactory(c => userService.CreateChannelManager(sessionId)));

            templateService = new TemplateService(endpoint);
            container.RegisterInstance(templateService);
            container.RegisterType<ChannelManager<ITemplateTcpService>>
                (new InjectionFactory(c => templateService.CreateChannelManager(sessionId)));

            workplaceService = new WorkplaceService(endpoint);
            container.RegisterInstance(workplaceService);
            container.RegisterType<ChannelManager<IWorkplaceTcpService>>
                (new InjectionFactory(c => workplaceService.CreateChannelManager(sessionId)));

            queuePlanService = new QueuePlanService(endpoint);
            container.RegisterInstance(queuePlanService);
            container.RegisterType<DuplexChannelManager<IQueuePlanTcpService>>
                (new InjectionFactory(c => queuePlanService.CreateChannelManager(sessionId)));

            lifeSituationService = new LifeSituationService(endpoint);
            container.RegisterInstance(lifeSituationService);
            container.RegisterType<ChannelManager<ILifeSituationTcpService>>
                (new InjectionFactory(c => lifeSituationService.CreateChannelManager(sessionId)));

            var theme = string.IsNullOrEmpty(administratorSettings.Theme)
                ? Templates.Themes.Default : administratorSettings.Theme;

            templateManager = new TemplateManager(Templates.Apps.Common, theme);
            container.RegisterInstance<ITemplateManager>(templateManager);
        }
        public void WorkplaceSaveDeleteTests()
        {
            var p = new Personnel();

            p.Name      = "علی ";
            p.LastName  = "قربانزاده";
            p.WorkGroup = new WorkGroup();


            var wp = new Workplace
            {
                Name = "دفتر کار",
                IsNotificationsEnabled = true,
                oneDeviceEnabled       = true,
            };

            wp.UserClockTypes.Add(new UserClockTypeViewModel
            {
                order = 0,
                type  = ClockType.Wifi,
            });
            wp.UserClockTypes.Add(new UserClockTypeViewModel
            {
                order = 1,
                type  = ClockType.CameraSelfie,
            });
            wp.UserClockTypes.Add(new UserClockTypeViewModel
            {
                order = 2,
                type  = ClockType.GPS,
            });
            wp.UserClockTypes.Add(new UserClockTypeViewModel
            {
                order = 3,
                type  = ClockType.QRCode,
            });

            /*wp.WorkplacePersonnels.Add(new WorkplacePersonnel
             * {
             *  Name = "",
             *  Personnel = p,
             *  Username = "******",
             *  Password = "******",
             *  IsAdmin = true,
             * });*/

            wp.Locations.Add(new MyLocation
            {
                accuracy  = 3,
                latitude  = 51,
                longitude = 165
            });

            wp.WorkplaceSettings.Add(new WorkplaceSetting
            {
            });

            //  wp.WorkplacePersonnels.Add(new );


            var service = new WorkplaceService();

            service.Save(wp);
            service.Delete(wp.Id);
        }
예제 #5
0
        private async void Connect()
        {
            if (workplaceService != null)
            {
                workplaceService.Dispose();
            }

            workplaceService = new WorkplaceService(Endpoint);

            if (channelManager != null)
            {
                channelManager.Dispose();
            }

            channelManager = workplaceService.CreateChannelManager();

            IsConnected = false;

            Workplaces = await Window.ExecuteLongTask(async () =>
             {
                 using (var channel = channelManager.CreateChannel())
                 {
                     return await channel.Service.GetWorkplacesLinks();
                 }
             });

            if (Workplaces == null)
            {
                return;
            }

            SelectedWorkplace = AppSettings.WorkplaceId != Guid.Empty ? AppSettings.WorkplaceId : Workplaces.First().Id;
            IsConnected = true;

            if (isConnected && IsRemember)
            {
                Login();
            }
        }