Esempio n. 1
0
        public CurrencyConversionLibrary(Session currentSession, string currencyFrom, string currencyTo)
        {
            this.SetDefaults(currentSession);
            this.ValueFrom = 1;

            this.Currencies = new CurrencyLibrary();
            this.ChangeCurrencyRates(currencyFrom, currencyTo);
        }
Esempio n. 2
0
        public ViewModels.EmailAlertViewModel GetEmailAlert(EmailAlertViewModel emailAlert)
        {
            CurrencyLibrary     cl           = new CurrencyLibrary();
            EmailAlertViewModel updatedAlert = emailAlert;

            updatedAlert.CurrenciesTo = cl.GetAllowedCurrenciesSelect(emailAlert.CurrencyFrom);
            return(updatedAlert);
        }
Esempio n. 3
0
        public CurrencyConversionLibrary(Session currentSession, CurrencyConversionViewModel ccModel, bool updateReversed)
        {
            this.SetDefaults(currentSession);

            this.Currencies = new CurrencyLibrary();
            this.ValueFrom  = ccModel.ValueFrom;
            this.ValueTo    = ccModel.ValueTo;
            this.ChangeCurrencyRates(ccModel.CurrencyFrom.ID, ccModel.CurrencyTo.ID, updateReversed);
        }
Esempio n. 4
0
        public CurrencyConversionLibrary(Classes.Session.Session currentSession)
        {
            this.SetDefaults(currentSession);
            this.ValueFrom = 1;

            this.Currencies = new CurrencyLibrary();

            this.ChangeCurrencyRates(this.DefaultFromCurrency, this.DefaultToCurrency);
        }
Esempio n. 5
0
        public ViewModels.RateTrendsViewModel GetInitialRateSettings(Session session)
        {
            CurrencyLibrary cLib = new CurrencyLibrary();

            return(new ViewModels.RateTrendsViewModel
            {
                BaseCurrency = session.Defaults.DefaultCurrencyFrom,
                Currencies = cLib.CurrencyFromSelect,
                LengthSelected = 1
            });
        }
Esempio n. 6
0
        public ViewModels.EmailAlertViewModel GetEmailAlert(Models.EmailAlertModel eam, bool isForEdit = false)
        {
            CurrencyLibrary cl = new CurrencyLibrary();

            return(new ViewModels.EmailAlertViewModel
            {
                Currencies = cl.CurrencyFromSelect,
                CurrenciesTo = cl.GetAllowedCurrenciesSelect(eam.CurrencyFrom),
                Email = eam.Email,
                CurrencyFrom = eam.CurrencyFrom,
                CurrencyTo = eam.CurrencyTo,
                PercentageChange = eam.PercentageChange,
                TimeToSend = eam.TimeToSend,
                IsForEdit = isForEdit
            });
        }
        public ViewModels.UserDashboardViewModel GetUserDashboardFromViewModel(ViewModels.UserDashboardViewModel udvm)
        {
            CurrencyLibrary cLib  = new CurrencyLibrary();
            CountryLookup   cLook = new CountryLookup();

            return(new ViewModels.UserDashboardViewModel
            {
                UserName = this.UserID,
                AutoUpdateTrackerDefault = udvm.AutoUpdateTrackerDefault,
                DefaultCountry = udvm.DefaultCountry,
                DefaultCurrencyFrom = udvm.DefaultCurrencyFrom,
                DefaultCurrencyTo = udvm.DefaultCurrencyTo,
                DisplayName = udvm.DisplayName,
                Email = udvm.Email,
                Countries = cLook.GetSelectList(),
                Currencies = cLib.CurrencyFromSelect,
                CurrenciesTo = cLib.GetAllowedCurrenciesSelect(udvm.DefaultCurrencyFrom)
            });
        }
        public ViewModels.UserDashboardViewModel GetUserDashboardInformation()
        {
            CurrencyLibrary cLib  = new CurrencyLibrary();
            CountryLookup   cLook = new CountryLookup();
            var             res   = DIResolver.Data.NinjectConfig.GetKernal().Get <Data.RepositoryInterfaces.IUserRepository>();

            Data.Entities.UserEntity user = res.GetUser(this.UserID);

            return(new ViewModels.UserDashboardViewModel
            {
                UserName = this.UserID,
                AutoUpdateTrackerDefault = user.AutoUpdateEntries,
                DefaultCountry = (user.DefaultCountry) ?? "",
                DefaultCurrencyFrom = user.DefaultCurrencyFrom,
                DefaultCurrencyTo = (user.DefaultCurrencyTo) ?? "",
                DisplayName = user.DisplayName,
                Email = user.Email,
                Countries = cLook.GetSelectList(),
                Currencies = cLib.CurrencyFromSelect,
                CurrenciesTo = cLib.GetAllowedCurrenciesSelect((user.DefaultCurrencyFrom) ?? "")
            });
        }