Ejemplo n.º 1
0
 public Task LoadOptions()
 {
     return(Task.Run(() =>
     {
         _dictOptions = _client.GetDictOptions(_userId);
         IsDictOptionsLoaded = true;
     }));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Verifies if there exists a specific command parameter
        /// </summary>
        /// <param name="key">name of the parameter to find</param>
        /// <returns></returns>
        protected bool HasParameter(string key)
        {
            if (DictOptions.ContainsKey(key))
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Verifies if the command parameters contain a specific key and that it has a value
        /// </summary>
        /// <param name="key">the key to verify for existens and value</param>
        /// <returns></returns>
        protected bool HasParameterWithValue(string key)
        {
            if (DictOptions.ContainsKey(key) && DictOptions.GetValueOrDefault(key) != string.Empty)
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 4
0
        public DictOptions GetDictOptions(int userId)
        {
            var dict = new DictOptions()
            {
                AccountNames = _dataAccess.GetAccountNames(userId),
                Categories   = GetCategories(),
                Currencies   = _dataAccess.GetCurrencies(),
            };

            return(dict);
        }