Example #1
0
        public PredefinedCurrency GetCurrecny(int currencyId)
        {
            setLanguage();
            PredefinedGuidesContent predefinedGuidesContent = GetPredefinedGuidesContent();
            var viewModel = predefinedGuidesContent.Currencies.FirstOrDefault(e => e.Id == currencyId);

            return(viewModel);
        }
Example #2
0
        public List <PredefinedAccount> GetGuideAccounts(int guideId)
        {
            setLanguage();
            PredefinedGuidesContent predefinedGuidesContent = GetPredefinedGuidesContent();
            var viewModels = predefinedGuidesContent.AccountGuides.FirstOrDefault(e => (int)e.Id == guideId).Accounts;

            return(viewModels);
        }
Example #3
0
 public PredefinedGuideService(
     IFileManager fileManager,
     ILanguageManager languageManager
     )
 {
     _fileManager             = fileManager;
     _predefinedGuidesContent = GetPredefinedGuidesContent();
     _languageManager         = languageManager;
     _language = _languageManager.GetLang();
 }
Example #4
0
        public List <AccountGuideViewModel> GetAccountGuides()
        {
            setLanguage();
            PredefinedGuidesContent predefinedGuidesContent = GetPredefinedGuidesContent();
            var viewModels = predefinedGuidesContent.AccountGuides.OrderBy(a => a.Order).Select(e => new AccountGuideViewModel
            {
                Id   = (int)e.Id,
                Name = e.GetName(_language)
            }).ToList();

            return(viewModels);
        }
Example #5
0
        public List <CurrencyViewModel> GetCurrencies()
        {
            setLanguage();
            PredefinedGuidesContent predefinedGuidesContent = GetPredefinedGuidesContent();
            var viewModels = predefinedGuidesContent.Currencies.ToList().OrderBy(a => a.Order)
                             .Select(e => new CurrencyViewModel
            {
                Id       = e.Id,
                Code     = e.Code,
                Name     = e.GetName(_language),
                ISOCode  = e.ISOCode,
                PartName = e.GetPartName(_language),
                PartRate = e.PartRate
            }).ToList();

            return(viewModels);
        }