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); }
/// <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; }
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); } }
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); }