private void ShowSetting(SettingCollection items, string split = "") { string controlName = ""; Action <string> callback = null; if (SelectedItem is ControlBase) { var control = SelectedItem as ControlBase; controlName = control.GetType().Name; callback = (value) => { control.Style = value; }; } else if (SelectedItem is GridColumn) { var control = SelectedItem as GridColumn; controlName = control.GetType().Name; callback = (value) => { control.Style = value; }; } else { return; } SettingSelectWindow win = new SettingSelectWindow(); GetSettingViewModel vm = new GetSettingViewModel( items, controlName, callback, split); win.DataContext = vm; win.ShowDialog(); }
private void InitializeSettings() { m_CounterSettings = new SettingCollection(); m_PaidSettings = new SettingCollection(); ConfigurationDataSet.SettingDataTable table = ConfigurationDataSet.Current.Setting; string filter = string.Format(CultureInfo.InvariantCulture, "{0} = {1}", table.SettingTypeIdColumn.ColumnName, (int)SettingType.Counter); foreach (ConfigurationDataSet.SettingRow row in table.Select(filter)) { m_CounterSettings.Add(SettingProvider.CreateSetting(row)); } filter = string.Format(CultureInfo.InvariantCulture, "{0} > 0", table.PriceColumn.ColumnName); foreach (ConfigurationDataSet.SettingRow row in table.Select(filter)) { if ((row.ShortName == "PhoneSupport") || (row.ShortName == "Training1Hour") || (row.ShortName == "Training3Hours") || (row.ShortName == "Training8Hours")) { continue; } m_PaidSettings.Add(SettingProvider.CreateSetting(row)); } }
public DeathLinker(SettingCollection settings, DeathLinkService service) { this.service = service; this.settings = settings; service.OnDeathLinkReceived += OnDeathLinkReceived; }
public static SettingCollection Search(SearchFilter value) { SettingCollection items = new SettingCollection(); //string key = string.Format(SETTINGS_Search_KEY, value.CompanyID+value.Keyword+value.Page+value.PageSize+value.OrderBy+value.OrderDirection) string key = string.Format(SETTINGS_Search_KEY, value.Keyword, value.Page, value.PageSize, value.OrderBy, value.OrderDirection, value.Condition); if (SystemConfig.AllowSearchCache) { object obj2 = HttpCache.Get(key); if ((obj2 != null)) { return((SettingCollection)obj2); } } using (var client = WebApiHelper.myclient(HouseEndpoint, SystemConst.APIJosonReturnValue)) { HttpResponseMessage response = client.PostAsJsonAsync(Resource + "?method=search", value).GetAwaiter().GetResult(); if (response.IsSuccessStatusCode) { items = response.Content.ReadAsAsync <SettingCollection>().GetAwaiter().GetResult(); } } if (SystemConfig.AllowSearchCache) { HttpCache.Max(key, items); } return(items); }
private static void SaveStartMenuCheckedItems(string value) { UserContext user = UserContext.Current; if (user != null) { SettingCollection settings = user.Settings; Setting setting = settings["StartMenuCheckedItems"]; if (setting != null) { if (string.IsNullOrEmpty(setting.Value) || (string.Compare(setting.Value, bool.TrueString, StringComparison.OrdinalIgnoreCase) == 0)) { setting.Value = value; } else { setting.Value += "," + value; } if ((ActionProvider.StartPageSettingsLevels & SettingLevels.Instance) == SettingLevels.Instance) { settings.UpdateValues(user.OrganizationId, user.InstanceId); } else { settings.UpdateValues(user.OrganizationId); } } } }
private void LoadSettings(bool alreadyFailed = false) { try { string rawSettings = File.ReadAllText(_settingsPath); this.Settings = JsonConvert.DeserializeObject <SettingCollection>(rawSettings, JsonReaderSettings) ?? new SettingCollection(false); } catch (FileNotFoundException) { // Likely don't have access to this filesystem } catch (Exception ex) { if (alreadyFailed) { Logger.Error(ex, "Failed to load settings due to an unexpected exception while attempting to read them. Already tried creating a new settings file, so we won't try again."); } else { Logger.Error(ex, "Failed to load settings due to an unexpected exception while attempting to read them. A new settings file will be generated."); // Refresh the settings PrepareSettingsFirstTime(); // Try to reload the settings LoadSettings(true); } } }
public SettingCollection FetchAll() { SettingCollection coll = new SettingCollection(); Query qry = new Query(Setting.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public ContentResult Search(SearchFilter SearchKey) { SearchKey.OrderBy = string.IsNullOrEmpty(SearchKey.OrderBy) ? "SettingID" : SearchKey.OrderBy; SettingCollection collection = SettingManager.Search(SearchKey); return(Content(JsonConvert.SerializeObject(collection), "application/json")); }
private void InitPhoneSupport() { SettingCollection settings = this.PaidSettings; Setting setting = settings["PhoneSupport"]; if (setting == null) { divPhoneSupport.Visible = false; return; } lPhoneSupport.Text = FrameworkConfiguration.Current.WebApplication.Support.Phone; bool isChecked = false; if (!Boolean.TryParse(setting.Value, out isChecked)) { if (!Boolean.TryParse(setting.DefaultValue, out isChecked)) { isChecked = false; } } if (isChecked && setting.Paid && setting.Price > 0) { m_TotalSum += setting.Price; } if (!IsPostBack) { chkPhoneSupport.Checked = isChecked; } }
private void List_DataBind() { this.OnDataBinding(EventArgs.Empty); SettingCollection settings = null; if (this.Settings != null) { settings = m_Settings.FindChildSettings(null); if (!this.DiagnoseConflictingSettings) { settings = settings.FindAllByVisible(true); } } if ((settings != null) && (settings.Count > 0)) { Repeater1.DataSource = settings; Repeater1.DataBind(); } else { PageContent.Visible = false; } }
private void LoadSettings(bool alreadyFailed = false) { string rawSettings = null; try { rawSettings = File.ReadAllText(_settingsPath); this.Settings = JsonConvert.DeserializeObject <SettingCollection>(rawSettings, JsonReaderSettings) ?? new SettingCollection(false); } catch (Exception ex) { if (alreadyFailed) { Logger.Warn(ex, "Failed to load settings due to an unexpected exception while attempting to read them. Already tried creating a new settings file, so we won't try again."); } else { Logger.Warn(ex, "Failed to load settings due to an unexpected exception while attempting to read them. A new settings file will be generated."); if (!string.IsNullOrEmpty(rawSettings)) { Logger.Info(rawSettings); } else { Logger.Warn("Settings were empty or could not be read."); } // Refresh the settings PrepareSettingsFirstTime(); // Try to reload the settings LoadSettings(true); } } }
protected void Edit(T item) { if (item == null) { item = new T(); } selectedItem = item; var vm = CreateViewModel(item); var window = CreateWindow(vm); window.ShowDialog(); if (vm.IsCancelled || item.Equals(vm.Setting)) { return; } var index = SettingCollection.IndexOf(item); if (index >= 0) { Remove(item); SettingCollection.Insert(index, vm.Setting); } else { SettingCollection.Add(vm.Setting); } IsDirty = true; }
/// <summary> /// Define the settings you would like to use in your module. Settings are persistent /// between updates to both Blish HUD and your module. /// </summary> protected override void DefineSettings(SettingCollection settings) { settings.DefineSetting("ExampleSetting.", "This is the value of the setting", "Display name of setting", "If exposed, this setting will be shown in settings with this description, automatically."); // Assigning the return value is the preferred way of keeping track of your settings _anotherExampleSetting = settings.DefineSetting("AnotherExample", true, "This setting is a bool setting.", "Settings can be many different types"); }
internal static List <Guid> GetStartMenuCheckedItems(UserContext user, out bool redirect) { redirect = false; if (user != null) { SettingCollection settings = user.Settings; Setting setting = settings["StartMenuCheckedItems"]; if (setting != null) { if (setting.ValueIsDefault) { redirect = true; } else if (!string.IsNullOrEmpty(setting.Value)) { if (setting.Value.EndsWith(bool.FalseString, StringComparison.OrdinalIgnoreCase)) { redirect = true; } else if (string.Compare(setting.Value, bool.TrueString, StringComparison.OrdinalIgnoreCase) == 0) { return(new List <Guid>()); } else { return(Support.ConvertStringToGuidList(setting.Value) as List <Guid>); } } } } return(null); }
void BindGrid() { SettingCollection settingCollection = SettingManager.GetAllSettings(); gvSettings.DataSource = settingCollection; gvSettings.DataBind(); }
/// <summary> /// use for scrolling page /// </summary> /// <returns></returns> public ContentResult GetPg(int page, int pagesize) { string condition = ""; SearchFilter SearchKey = SearchFilter.SearchPG(CurrentUser.CompanyID, page, pagesize, "SettingID", "SettingID", "Desc", condition); SettingCollection objItem = SettingManager.Search(SearchKey); return(Content(JsonConvert.SerializeObject(objItem), "application/json")); }
public void SetSettings(SettingCollection settingsCollection) { settings = settingsCollection; fadeEnd = TimeSpan.FromSeconds(settingsCollection.OnScreenLogLineScreenTime.Value); fadeStart = TimeSpan.FromSeconds(settingsCollection.OnScreenLogLineScreenTime.Value * 0.8); fadeTime = fadeEnd - fadeStart; }
private SettingsManager(ModuleManager module) { if (module.State.Settings == null) { module.State.Settings = new SettingCollection(true); } this.ModuleSettings = module.State.Settings; }
/// <summary> /// Sends the Grbl '$$' command with messenger to Main class to get all particular $x=var settings of the machine /// </summary> public void RefreshSetting() { if (SettingCollection.Count > 0) { SettingCollection.Clear(); } logger.Debug("SettingViewModel|Send notification"); SendSettingMessage(); }
protected override void DefineSettings(SettingCollection settings) { _settingCursorThickness = settings.DefineSetting("CursorThickness", 3, "Cursor Thickness"); _settingCursorThickness.SetRange(2, 10); _settingCursorThickness.SettingChanged += UpdateCursorThickness; _settingSkipUpdates = settings.DefineSetting("SkipUpdates", 10, "Stabilisation", "Higher settings help prevent the cursor from jumping when releasing RMB but may cause a stutter instead."); _settingSkipUpdates.SetRange(0, 20); }
private bool Validate(ExternalCommand externalCommand, ref string error) { if (SettingCollection.Any(ec => ec.Name == externalCommand.Name) && externalCommand.Name != selectedItem.Name) { error = $"{externalCommand.Name} is already exists."; return(false); } return(true); }
public OmniPageOcrEngine() { Engine.Init(null, null, csdkpath: @"C:\Program Files (x86)\Nuance\OPCaptureSDK20\Bin"); _settings = new SettingCollection { DefaultRecognitionModule = RECOGNITIONMODULE.RM_AUTO, DefaultFillingMethod = FILLINGMETHOD.FM_DEFAULT, DefaultFilter = CHR_FILTER.FILTER_UPPERCASE }; }
private void DefineSettings(SettingCollection settings) { this.UserLocale = settings.DefineSetting("AppCulture", GetGw2LocaleFromCurrentUICulture(), Strings.GameServices.OverlayService.Setting_AppCulture_DisplayName, Strings.GameServices.OverlayService.Setting_AppCulture_Description); this.StayInTray = settings.DefineSetting("StayInTray", true, Strings.GameServices.OverlayService.Setting_StayInTray_DisplayName, Strings.GameServices.OverlayService.Setting_StayInTray_Description); this.ShowInTaskbar = settings.DefineSetting("ShowInTaskbar", false, Strings.GameServices.OverlayService.Setting_ShowInTaskbar_DisplayName, Strings.GameServices.OverlayService.Setting_ShowInTaskbar_Description); this.ShowInTaskbar.SettingChanged += ShowInTaskbarOnSettingChanged; this.UserLocale.SettingChanged += UserLocaleOnSettingChanged; ApplyInitialSettings(); }
public static void OnChangeRoom( Level level, SeedOptions seedOptions, SettingCollection gameSettings, ItemLocationMap itemLocations, ScreenManager screenManager, int levelId, int roomId) { var roomKey = new RoomItemKey(levelId, roomId); if (RoomTriggers.TryGetValue(roomKey, out var trigger)) { trigger.trigger(level, itemLocations[roomKey], seedOptions, gameSettings, screenManager); } }
protected override void DefineSettings(SettingCollection settings) { _settingCompassSize = settings.DefineSetting("CompassSize", 0.5f, "Compass Size", "Size of the compass elements."); _settingCompassRadius = settings.DefineSetting("CompassRadius", 0f, "Compass Radius", "Radius of the compass."); _settingVerticalOffset = settings.DefineSetting("VerticalOffset", VERTICALOFFSET_MIDDLE, "Vertical Offset", "How high to offset the compass off the ground."); _settingCompassSize.SetRange(0.1f, 2f); _settingCompassRadius.SetRange(0f, 4f); _settingVerticalOffset.SetRange(0f, VERTICALOFFSET_MIDDLE * 2); _settingCompassSize.SettingChanged += UpdateBillboardSize; }
public void SetSeedAndFillingMethod(Seed selectedSeed, FillingMethod choosenFillingMethod, SettingCollection selectedSettings) { seed = selectedSeed; fillingMethod = choosenFillingMethod; settings = selectedSettings; seedRepresentation.SetSeed(selectedSeed); SetSelectedMenuItemByIndex(2); EnableAllMenuItems(); }
public static void UpdateMinimapColors(this GCM gameContentManager, SettingCollection settings) { SetColor(gameContentManager, ColorPositions[EMinimapRoomColor.Blue], settings.PastMinimapColor.Color); SetColor(gameContentManager, ColorPositions[EMinimapRoomColor.Purple], settings.PresentMinimapColor.Color); SetColor(gameContentManager, ColorPositions[EMinimapRoomColor.Green], settings.PyramidMinimapColor.Color); SetColor(gameContentManager, ColorPositions[EMinimapRoomColor.Orange], settings.LootMinimapColor.Color); SetColor(gameContentManager, ColorPositions[EMinimapRoomColor.Red], settings.SaveStatueMinimapColor.Color); SetColor(gameContentManager, ColorPositions[EMinimapRoomColor.Yellow], settings.SpecailLootMinimapColor.Color); SetColor(gameContentManager, ColorPositions[EMinimapRoomColor.SpecialBlue], settings.PresentTransitionMinimapColor.Color); SetColor(gameContentManager, ColorPositions[EMinimapRoomColor.SpecialPurple], settings.PastTransitionMinimapColor.Color); }
public MainWindow() { try { eventBus = new EventBus(); Container.Current.Register <IEventBus>(eventBus); //Fixes an issue with current directory being system32 for the plugin loader and not the application path as desired eventBus.Publish(new LogEntryPublished("Heibroch.Launch - Initializing", "Setting base directory...", EventLogEntryType.Information)); Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); eventBus.Publish(new LogEntryPublished("Heibroch.Launch - Initializing", "Initializing components...", EventLogEntryType.Information)); InitializeComponent(); var logService = new LogService(eventBus); Container.Current.Register <ILogService>(logService); eventBus.Publish(new LogEntryPublished("Heibroch.Launch - Initializing", "Initializing plugin loader...", EventLogEntryType.Information)); pluginLoader = new PluginLoader(eventBus, Container.Current); Container.Current.Register <IPluginLoader>(pluginLoader); eventBus.Publish(new LogEntryPublished("Heibroch.Launch - Initializing", "Initializing shortcut collection...", EventLogEntryType.Information)); var shortcutCollection = new ShortcutCollection(pluginLoader, eventBus); Container.Current.Register <IShortcutCollection <string, ILaunchShortcut> >(shortcutCollection); eventBus.Publish(new LogEntryPublished("Heibroch.Launch - Initializing", "Initializing shortcut executor...", EventLogEntryType.Information)); var shortcutExecutor = new ShortcutExecutor(shortcutCollection); Container.Current.Register <IShortcutExecutor>(shortcutExecutor); eventBus.Publish(new LogEntryPublished("Heibroch.Launch - Initializing", "Initializing setting collection...", EventLogEntryType.Information)); var settingCollection = new SettingCollection(eventBus); Container.Current.Register <ISettingCollection>(settingCollection); eventBus.Publish(new LogEntryPublished("Heibroch.Launch - Initializing", "Initializing plugins...", EventLogEntryType.Information)); pluginLoader.Load(); eventBus.Publish(new ProgramLoadedEvent()); eventBus.Publish(new LogEntryPublished("Heibroch.Launch - Initializing", "Initializing main view model...", EventLogEntryType.Information)); DataContext = new MainViewModel(eventBus, shortcutCollection, shortcutExecutor, settingCollection, pluginLoader); eventBus.Publish(new LogEntryPublished("Heibroch.Launch - Initializing", "Initializing hooks...", EventLogEntryType.Information)); hookId = SetHook(proc); Closing += OnMainWindowClosing; eventBus.Publish(new LogEntryPublished("Heibroch.Launch - Initializing", "Initialization complete", EventLogEntryType.Information)); } catch (Exception ex) { eventBus.Publish(new LogEntryPublished("Heibroch.Launch", ex.StackTrace, EventLogEntryType.Error)); throw ex; } }
protected override void Initialize() { _characterRepository = new Dictionary <string, string>(); _sharedCacheMethod = new MemoryCacheMethod(); _sharedConnection = new Connection(String.Empty, (Locale)Overlay.UserLocale, new HttpClient(), _sharedCacheMethod); /*, $"{Program.APP_VERSION.Replace('@', '/')} blish-hud/Blish-HUD (Using Gw2Sharp/{typeof(Connection).GetTypeInfo().Assembly.GetName().Version.ToString(3)} Archomeda/Gw2Sharp)", new HttpClient(), _sharedCacheMethod);*/ _sharedClient = new Gw2WebApiClient(_sharedConnection); _apiSettings = Settings.RegisterRootSettingCollection(GW2API_SETTINGS); DefineSettings(_apiSettings); }
public JsonResult GetGata([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel) { SearchFilter SearchKey = SearchFilter.SearchData(CurrentUser.CompanyID, requestModel, "SettingID", "SettingID"); SettingCollection collection = SettingManager.Search(SearchKey); int TotalRecord = 0; if (collection.Count > 0) { TotalRecord = collection[0].TotalRecord; } //SettingCollection data = SettingManager.GetAll(CurrentUser.CompanyID); return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet)); }
public ActionResult Save(Bam.Net.UserAccounts.Data.Setting[] values) { try { SettingCollection saver = new SettingCollection(); saver.AddRange(values); saver.Save(); return(Json(new { Success = true, Message = "", Dao = "" })); } catch (Exception ex) { return(GetErrorResult(ex)); } }
private static SettingCollection DBMapping(DBSettingCollection dbCollection) { if (dbCollection == null) return null; SettingCollection collection = new SettingCollection(); foreach (DBSetting dbItem in dbCollection) { Setting item = DBMapping(dbItem); collection.Add(item); } return collection; }
} // ApplicationSettings // ---------------------------------------------------------------------- public ApplicationSettings( string settingsKey, object obj ) : base( settingsKey ) { settings = new SettingCollection( this ); // provider defaultProvider = new LocalFileSettingsProvider(); defaultProvider.Initialize( "LocalFileSettingsProvider", new NameValueCollection() ); base.Providers.Add( defaultProvider ); // upgrade upgradeSettings = new ValueSetting( UpgradeSettingsKey, typeof( bool ), true ); UseAutoUpgrade = true; if ( obj != null ) { Settings.AddAll( obj ); } } // ApplicationSettings
public SettingCollection FetchByID(object SettingID) { SettingCollection coll = new SettingCollection().Where("SettingID", SettingID).Load(); return coll; }
public void InitializeSettings(List<Setting> result) { _settings = new SettingCollection(); _settings.AddRange(result); }
private void InitClassVariables(Guid OrgId, Guid InstanceId, int DeptID) { Instance currentInstance = null; if (OrgId == Guid.Empty && Micajah.Common.Security.UserContext.Current != null && Micajah.Common.Security.UserContext.Current.SelectedOrganization != null) OrgId = Micajah.Common.Security.UserContext.Current.SelectedOrganization.OrganizationId; if (Micajah.Common.Security.UserContext.Current != null && Micajah.Common.Security.UserContext.Current.SelectedInstance != null && InstanceId == Micajah.Common.Security.UserContext.Current.SelectedInstance.InstanceId) { currentInstance = Micajah.Common.Security.UserContext.Current.SelectedInstance; // Current context } else { currentInstance = Micajah.Common.Bll.Providers.InstanceProvider.GetInstance(InstanceId, OrgId); // Looking through all dbs } if (currentInstance != null) { #region Load settings SettingCollection settings = currentInstance.Settings; InternalSettings = settings; InternalInstance = currentInstance; Setting setting = null; setting = settings.FindByShortName("configOnHoldStatus"); if (setting != null) bool.TryParse(setting.Value, out OnHoldStatus); //On Hold Status setting = settings.FindByShortName("configTimetracking"); if (setting != null) bool.TryParse(setting.Value, out TimeTracking); //Time Tracking setting = settings.FindByShortName("configPartsTracking"); if (setting != null) bool.TryParse(setting.Value, out PartsTracking); //Parts Tracking setting = settings.FindByShortName("ConfigtechCheckin"); if (setting != null) bool.TryParse(setting.Value, out TechCheckin); //Tech Checking setting = settings.FindByShortName("configLocationTracking"); if (setting != null) bool.TryParse(setting.Value, out LocationTracking); //Location Tracking setting = settings.FindByShortName("btCfgKB"); if (setting != null) bool.TryParse(setting.Value, out KBTracking); //Knowledgebase Tracking setting = settings.FindByShortName("btCfgProject"); if (setting != null) bool.TryParse(setting.Value, out ProjectTracking); //Projects Tracking setting = settings.FindByShortName("configChooseTechnician"); if (setting != null) bool.TryParse(setting.Value, out TechChoose); setting = settings.FindByShortName("ConfigNewUserWizard"); if (setting != null) bool.TryParse(setting.Value, out NewUserWizard); setting = settings.FindByShortName("configSerialNumber"); if (setting != null) bool.TryParse(setting.Value, out SerialNumber); setting = settings.FindByShortName("SerialNumberName"); this.SerialNumberName = (setting == null) ? "Serial Number" : Convert.ToString(setting.Value); setting = settings.FindByShortName("btCfgSchedTkt"); if (setting != null) bool.TryParse(setting.Value, out ScheduledTickets); setting = settings.FindByShortName("configFolders"); if (setting != null) bool.TryParse(setting.Value, out Folders); setting = settings.FindByShortName("configAssetTracking"); if (setting != null) bool.TryParse(setting.Value, out AssetTracking); setting = settings.FindByShortName("configClassTracking"); if (setting != null) bool.TryParse(setting.Value, out ClassTracking); setting = settings.FindByShortName("configPriorities"); if (setting != null) bool.TryParse(setting.Value, out PrioritiesGeneral); setting = settings.FindByShortName("configUserPriorities"); if (setting != null) bool.TryParse(setting.Value, out PrioritiesUser); setting = settings.FindByShortName("btCfgPRL"); if (setting != null) bool.TryParse(setting.Value, out PrioritiesLog); setting = settings.FindByShortName("configChooseTechLimitQues"); if (setting != null) bool.TryParse(setting.Value, out ChooseTechLimitQues); setting = settings.FindByShortName("configCategoryTracking"); if (setting != null) bool.TryParse(setting.Value, out CategoryTracking); setting = settings.FindByShortName("btCfgRES"); if (setting != null) bool.TryParse(setting.Value, out ResolutionTracking); setting = settings.FindByShortName("btCfgCON"); if (setting != null) bool.TryParse(setting.Value, out ConfirmationTracking); setting = settings.FindByShortName("btCfgEAHA"); if (setting != null) bool.TryParse(setting.Value, out AfterHoursAlert); setting = settings.FindByShortName("configCustomFields"); if (setting != null) bool.TryParse(setting.Value, out CustomFields); setting = settings.FindByShortName("configMiscCost"); if (setting != null) bool.TryParse(setting.Value, out MiscCosts); setting = settings.FindByShortName("configTrvlCost"); if (setting != null) bool.TryParse(setting.Value, out TravelCosts); setting = settings.FindByShortName("configViewTktCost"); if (setting != null) bool.TryParse(setting.Value, out ViewTktCosts); setting = settings.FindByShortName("configUAQ"); if (setting != null) bool.TryParse(setting.Value, out UnassignedQue); setting = settings.FindByShortName("configLVL"); if (setting != null) bool.TryParse(setting.Value, out TktLevels); setting = settings.FindByShortName("btConfigLVLUser"); if (setting != null) bool.TryParse(setting.Value, out TktLevelsForUser); setting = settings.FindByShortName("configRCD"); if (setting != null) bool.TryParse(setting.Value, out RequestCompletionDate); setting = settings.FindByShortName("btCfgAcctMngr"); if (setting != null) bool.TryParse(setting.Value, out AccountManager); setting = settings.FindByShortName("btCfgACDC"); if (setting != null) bool.TryParse(setting.Value, out TktClosureDate); setting = settings.FindByShortName("btCfgAFTE"); if (setting != null) bool.TryParse(setting.Value, out ForceTimeEntry); setting = settings.FindByShortName("btCfgAECT"); if (setting != null) bool.TryParse(setting.Value, out TktCreationTimeSupport); setting = settings.FindByShortName("btCfgSuppressBWALogos"); if (setting != null) bool.TryParse(setting.Value, out SuppresBWALogos); setting = settings.FindByShortName("btCfgESG"); if (setting != null) bool.TryParse(setting.Value, out SupportGroups); setting = settings.FindByShortName("btCfgIDM"); if (setting != null) bool.TryParse(setting.Value, out TktIDMethod); setting = settings.FindByShortName("btCfgCCS"); if (setting != null) bool.TryParse(setting.Value, out CallCenterSupport); setting = settings.FindByShortName("btCfgESC"); if (setting != null) bool.TryParse(setting.Value, out SubmissionCategory); setting = settings.FindByShortName("btCfgEMTE"); if (setting != null) bool.TryParse(setting.Value, out MultipleTimeEntry); setting = settings.FindByShortName("btCfgSBTP"); if (setting != null) bool.TryParse(setting.Value, out SignatureBlockPrintedTkt); setting = settings.FindByShortName("btCfgCUSN"); if (setting != null) bool.TryParse(setting.Value, out CustomNames); setting = settings.FindByShortName("btCfgACCT"); if (setting != null) bool.TryParse(setting.Value, out AllowCCTktClosing); setting = settings.FindByShortName("btCfgRAST"); if (setting != null) bool.TryParse(setting.Value, out RemoteAssistance); setting = settings.FindByShortName("btCfgASTT"); if (setting != null) bool.TryParse(setting.Value, out AllowViewSchedTtkTech); setting = settings.FindByShortName("btCfgATCL"); if (setting != null) bool.TryParse(setting.Value, out TechChooseLevel); setting = settings.FindByShortName("btCfgCFTO"); if (setting != null) bool.TryParse(setting.Value, out DisplayCustFieldsForTech); setting = settings.FindByShortName("btCfgTROL"); if (setting != null) bool.TryParse(setting.Value, out AllowTechReopenTicket); setting = settings.FindByShortName("btCfgTEDO"); if (setting != null) bool.TryParse(setting.Value, out AllowTechEscalateDescalateOnly); setting = settings.FindByShortName("btReqClosureNote"); if (setting != null) bool.TryParse(setting.Value, out TktRequireClosureNote); setting = settings.FindByShortName("btCfgLimTechAsts"); if (setting != null) bool.TryParse(setting.Value, out LimitTechAbilityInAssets); setting = settings.FindByShortName("btGlobalSSL"); if (setting != null) bool.TryParse(setting.Value, out HTTPSEnabled); setting = settings.FindByShortName("btCfgDTTCOT"); if (setting != null) bool.TryParse(setting.Value, out DisableTransferTktsToCheckedOUTTechs); setting = settings.FindByShortName("btAllowSUserToChooseAnyLogin"); if (setting != null) bool.TryParse(setting.Value, out AllowSUserToChooseAnyLogin); setting = settings.FindByShortName("btGeneralLdap"); if (setting != null) bool.TryParse(setting.Value, out EnableLDAP); setting = settings.FindByShortName("btGlobalLDAP"); if (setting != null) bool.TryParse(setting.Value, out EnableLDAPGlobal); setting = settings.FindByShortName("btLdapARLP"); if (setting != null) bool.TryParse(setting.Value, out EnableLDAPAutoRedirect); setting = settings.FindByShortName("btLdap"); if (setting != null) bool.TryParse(setting.Value, out EnableLDAPEmailExtUrl); setting = settings.FindByShortName("LdapLocalURL"); LDAPLocalUrl = (setting == null || string.IsNullOrEmpty(setting.Value)) ? LDAPLocalUrl : setting.Value; setting = settings.FindByShortName("charCurrency"); currency = (setting == null) ? String.Empty : setting.Value; setting = settings.FindByShortName("btCfgFLCN"); if (setting != null) bool.TryParse(setting.Value, out ForceLowestClassNode); setting = settings.FindByShortName("btCfgATTU"); if (setting != null) bool.TryParse(setting.Value, out AllowTransferTicketUser); setting = settings.FindByShortName("btDisplayAddUserLink"); if (setting != null) bool.TryParse(setting.Value, out DisplayAddNewUserLink); setting = settings.FindByShortName("btEnterTimeOnTktDtl"); if (setting != null) bool.TryParse(setting.Value, out AllowEnterTimeOnTicketDetail); setting = settings.FindByShortName("btTkt2PrjRelation"); if (setting != null) bool.TryParse(setting.Value, out EnableTicketToProjectRelation); setting = settings.FindByShortName("btStartStopOnTktDtl"); if (setting != null) bool.TryParse(setting.Value, out AllowStartStopTimeOnTicketDetail); setting = settings.FindByShortName("btRemHoursOnTktDtl"); if (setting != null) bool.TryParse(setting.Value, out AllowRemainHoursOnTicketDetail); this.assets = new AssetsConfig((settings.FindByShortName("AssetsUnique1Caption") == null) ? string.Empty : (settings.FindByShortName("AssetsUnique1Caption")).Value , (settings.FindByShortName("AssetsUnique2Caption") == null) ? string.Empty : (settings.FindByShortName("AssetsUnique2Caption")).Value , (settings.FindByShortName("AssetsUnique3Caption") == null) ? string.Empty : (settings.FindByShortName("AssetsUnique3Caption")).Value , (settings.FindByShortName("AssetsUnique4Caption") == null) ? string.Empty : (settings.FindByShortName("AssetsUnique4Caption")).Value , (settings.FindByShortName("AssetsUnique5Caption") == null) ? string.Empty : (settings.FindByShortName("AssetsUnique5Caption")).Value , (settings.FindByShortName("AssetsUnique6Caption") == null) ? string.Empty : (settings.FindByShortName("AssetsUnique6Caption")).Value , (settings.FindByShortName("AssetsUnique7Caption") == null) ? string.Empty : (settings.FindByShortName("AssetsUnique7Caption")).Value ); setting = settings.FindByShortName("btCfgRTIP"); if (setting != null) bool.TryParse(setting.Value, out RequireTktInitialPost); setting = settings.FindByShortName("btEnableGlobalAPI"); if (setting != null) bool.TryParse(setting.Value, out EnableGlobalAPI); setting = settings.FindByShortName("btTimeEntriesOnTktLog"); if (setting != null) bool.TryParse(setting.Value, out AllowTimeEntriesOnTktLog); setting = settings.FindByShortName("btCfgLWP"); if (setting != null) bool.TryParse(setting.Value, out AllowUserLoginWithoutPassword); setting = settings.FindByShortName("btCfgERTS"); if (setting != null) bool.TryParse(setting.Value, out RelatedTickets); this.BetaFeaturesEnabled = currentInstance.Beta; setting = settings.FindByShortName("emailSuffixes"); EmailSuffixes = (setting == null) ? string.Empty : setting.Value; setting = settings.FindByShortName("AccLevelTimeTracking"); if (setting != null) bool.TryParse(setting.Value, out AccLevelTimeTracking); setting = settings.FindByShortName("tintCfgEParserV2"); if (setting != null) byte.TryParse(setting.Value, out EMailParserV2); setting = settings.FindByShortName("btBCIntegration"); if (setting != null) bool.TryParse(setting.Value, out BCIntegration); setting = settings.FindByShortName("CfgAssetAuditor"); if (setting != null) bool.TryParse(setting.Value, out EnableAssetAuditor); setting = settings.FindByShortName("WarehouseIntegrationEnabled"); if (setting != null) bool.TryParse(setting.Value, out WarehouseIntegrationEnabled); setting = settings.FindByShortName("btQBIntegration"); if (setting != null) bool.TryParse(setting.Value, out QBIntegration); setting = settings.FindByShortName("btCfgSupportPortal"); if (setting != null) bool.TryParse(setting.Value, out SupportPortal); setting = settings.FindByShortName("hrIncrement"); if (setting != null) decimal.TryParse(setting.Value, out HourIncrement); setting = settings.FindByShortName("MinLogTime"); if (setting != null) decimal.TryParse(setting.Value, out MinimumLoggableTime); setting = settings.FindByShortName("DefaultDistanceRate"); if (setting != null) decimal.TryParse(setting.Value, out DefaultDistanceRate); bool limitNewUsersToKnownEmailSuffixes = false; bool disableCSS = false; setting = settings.FindByShortName("btSPLimitNewUsersToKnownEmailSuffixes"); if (setting != null) bool.TryParse(setting.Value, out limitNewUsersToKnownEmailSuffixes); setting = settings.FindByShortName("SPDisableCSS"); if (setting != null) bool.TryParse(setting.Value, out disableCSS); support = new SupportPortalConfig(limitNewUsersToKnownEmailSuffixes, (settings.FindByShortName("SupportPhone") == null) ? string.Empty : (settings.FindByShortName("SupportPhone")).Value, (settings.FindByShortName("SupportEmail") == null) ? string.Empty : (settings.FindByShortName("SupportEmail")).Value, (settings.FindByShortName("SPTitle") == null) ? string.Empty : (settings.FindByShortName("SPTitle")).Value, (settings.FindByShortName("LogoBackLinkURL") == null) ? string.Empty : (settings.FindByShortName("LogoBackLinkURL")).Value, disableCSS, (settings.FindByShortName("SPFacebook") == null) ? string.Empty : (settings.FindByShortName("SPFacebook")).Value, (settings.FindByShortName("SPTwitter1") == null) ? string.Empty : (settings.FindByShortName("SPTwitter1")).Value, (settings.FindByShortName("SPTwitter2") == null) ? string.Empty : (settings.FindByShortName("SPTwitter2")).Value); // New settings from tbl_company setting = settings.FindByShortName("intLicensedUsers"); if (setting != null) int.TryParse(setting.Value, out LicensedUsers); setting = settings.FindByShortName("configHourlyRate"); if (setting != null) decimal.TryParse(setting.Value, out HourlyRate); setting = settings.FindByShortName("TktExportdtStart"); if (setting != null) DateTime.TryParse(setting.Value, out TktExportStart); setting = settings.FindByShortName("TktExportdtEnd"); if (setting != null) DateTime.TryParse(setting.Value, out TktExportEnd); setting = settings.FindByShortName("intLicensedAssets"); if (setting != null) int.TryParse(setting.Value, out LicensedAssets); setting = settings.FindByShortName("configExpectDueDateUser"); if (setting != null) bool.TryParse(setting.Value, out ExpectDueDateUser); setting = settings.FindByShortName("tinyBusHourStart"); if (setting != null) int.TryParse(setting.Value, out BusHourStart); setting = settings.FindByShortName("tinyBusMinStart"); if (setting != null) int.TryParse(setting.Value, out BusMinStart); setting = settings.FindByShortName("tinyBusHourStop"); if (setting != null) int.TryParse(setting.Value, out BusHourStop); setting = settings.FindByShortName("tinyBusMinStop"); if (setting != null) int.TryParse(setting.Value, out BusMinStop); this.WorkingDays = currentInstance.WorkingDays; setting = settings.FindByShortName("tintRoutingOrder"); if (setting != null) int.TryParse(setting.Value, out RoutingOrder); setting = settings.FindByShortName("btAcctRtOvr"); if (setting != null) bool.TryParse(setting.Value, out AcctRtOvr); setting = settings.FindByShortName("tintAcctRtOvrLevel"); if (setting != null) int.TryParse(setting.Value, out AcctRtOvrLevel); setting = settings.FindByShortName("tintAcctRtOvrOption"); if (setting != null) int.TryParse(setting.Value, out AcctRtOvrOption); setting = settings.FindByShortName("tintAcctRtOvrRouteType"); if (setting != null) int.TryParse(setting.Value, out AcctRtOvrRouteType); setting = settings.FindByShortName("RemoteAssistanceSessions"); if (setting != null) int.TryParse(setting.Value, out RemoteAssistanceSessions); setting = settings.FindByShortName("CreationCatId"); if (setting != null) int.TryParse(setting.Value, out CreationCatId); setting = settings.FindByShortName("tintTicketTimer"); if (setting != null) int.TryParse(setting.Value, out TicketTimer); setting = settings.FindByShortName("intUTROL"); if (setting != null) int.TryParse(setting.Value, out TicketReopenLimitUser); setting = settings.FindByShortName("intTTROL"); if (setting != null) int.TryParse(setting.Value, out TicketReopenLimitTechnician); setting = settings.FindByShortName("configHourlyBillableRate"); if (setting != null) decimal.TryParse(setting.Value, out HourlyBillableRate); setting = settings.FindByShortName("CfgQBAccount"); QBAccount = (setting == null) ? string.Empty : Convert.ToString(setting.Value); setting = settings.FindByShortName("btFBIntegration"); if (setting != null) bool.TryParse(setting.Value, out FBIntegration); setting = settings.FindByShortName("FBClientId"); if (setting != null) int.TryParse(setting.Value, out FBClientId); setting = settings.FindByShortName("FBEndPointURL"); FBEndPointURL = (setting == null) ? string.Empty : Convert.ToString(setting.Value); setting = settings.FindByShortName("FBToken"); FBToken = (setting == null) ? string.Empty : Convert.ToString(setting.Value); setting = settings.FindByShortName("BCEndPointURL"); BCEndPointURL = (setting == null) ? string.Empty : Convert.ToString(setting.Value); setting = settings.FindByShortName("BCToken"); BCToken = (setting == null) ? string.Empty : Convert.ToString(setting.Value); setting = settings.FindByShortName("CfgInternalQBAccount"); InternalQBAccount = (setting == null) ? string.Empty : Convert.ToString(setting.Value); setting = settings.FindByShortName("btCfgBilling"); if (setting != null) bool.TryParse(setting.Value, out EnableBilling); setting = settings.FindByShortName("btCfgStaffPayments"); if (setting != null) bool.TryParse(setting.Value, out EnablePayments); setting = settings.FindByShortName("configUCP"); if (setting != null) bool.TryParse(setting.Value, out PrioritiesUserCreateTicket); setting = settings.FindByShortName("btCfgToDo"); if (setting != null) bool.TryParse(setting.Value, out EnableToDo); setting = settings.FindByShortName("btCfgContactUsWidget"); if (setting != null) bool.TryParse(setting.Value, out EnableContactUsWidget); setting = settings.FindByShortName("CUWClassID"); if (setting != null) int.TryParse(setting.Value, out CUWClassID); setting = settings.FindByShortName("FBURL"); FBURL = (setting == null) ? string.Empty : Convert.ToString(setting.Value); setting = settings.FindByShortName("FBAccessToken"); FBAccessToken = (setting == null) ? string.Empty : Convert.ToString(setting.Value); setting = settings.FindByShortName("FBAccessTokenSecret"); FBAccessTokenSecret = (setting == null) ? string.Empty : Convert.ToString(setting.Value); #endregion } try { DataTable deploymentLoggerData = BWA.bigWebDesk.BLL.DeploymentLogger.GetCompanyData(DBAccess.GetCurrentOrgID(Guid.Empty), DeptID); if (deploymentLoggerData != null && deploymentLoggerData.Rows.Count > 0) { this.DeploymentLoggerSettedUp = true; this.DeploymentLoggerEnabled = (bool)deploymentLoggerData.Rows[0]["Enabled"]; } } catch { } }
public SettingCollection FetchByQuery(Query qry) { SettingCollection coll = new SettingCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }