Ejemplo n.º 1
0
        public void SaveClientApplication(ClientApplication application)
        {
            var applicationLocal = new ClientApplicationLocal
                                                          {
                                                              AppTypeId = (int)VirtualCityApp.Ditributr,
                                                              CanSync = application.CanSync,
                                                              DateInitialized = application.DateInitialized,
                                                              HostName = application.HostName,
                                                              ClientAppId = application.Id,
                                                          };

            _configRepository.SaveClientApplication(applicationLocal);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Double dispatch
        /// </summary>
        /// <param name="settingsRepository"></param>
        /// <param name="configService"></param>
        public static ClientApplication AppIdSetup(ISettingsRepository settingsRepository,IConfigService configService)
        {
            var allowDecimal = settingsRepository.GetByKey(SettingsKeys.AllowDecimal);
            SetQuantityFormat(allowDecimal);
            Guid appId = configService.GetClientAppId();
            string hostname = Dns.GetHostName();

            ClientApplication clientApplication = configService.GetClientApplications().FirstOrDefault(s => s.Id == appId);
            if (clientApplication == null)
            {
                clientApplication = new ClientApplication();
                clientApplication.CanSync = false;
                clientApplication.DateInitialized = DateTime.Now;
            }
            clientApplication.HostName = hostname;
            clientApplication.Id = appId;
            configService.SaveClientApplication(clientApplication);
            return clientApplication;
        }
Ejemplo n.º 3
0
        private static void AppIdSetup()
        
        {
            using (var c = ObjectFactory.Container.GetNestedContainer())
            {
                IConfigService configService = c.GetInstance<IConfigService>();
                Guid appId = configService.GetClientAppId();
                string hostname = Dns.GetHostName();

                ClientApplication clientApplication = configService.GetClientApplications().FirstOrDefault(s => s.Id == appId);
                if (clientApplication == null)
                {
                    clientApplication = new ClientApplication();
                    clientApplication.CanSync = false;
                    clientApplication.DateInitialized = DateTime.Now;

                }
                clientApplication.HostName = hostname;
                clientApplication.Id = appId;
                configService.SaveClientApplication(clientApplication);
            }
        }
Ejemplo n.º 4
0
        private static void AppIdSetup()
        {
                IConfigService configService = Services.Using<IConfigService>();
                Guid appId = configService.GetClientAppId();
                string hostname = Dns.GetHostName();

                ClientApplication clientApplication = configService.GetClientApplications().FirstOrDefault(s => s.Id == appId);
                if (clientApplication == null)
                {
                    clientApplication = new ClientApplication();
                    clientApplication.CanSync = false;
                    clientApplication.DateInitialized = DateTime.Now;
                }
                clientApplication.HostName = hostname;
                clientApplication.Id = appId;
                configService.SaveClientApplication(clientApplication);
        }