コード例 #1
0
        public CurrencyConversionLibrary(Session currentSession, string currencyFrom, string currencyTo)
        {
            this.SetDefaults(currentSession);
            this.ValueFrom = 1;

            this.Currencies = new CurrencyLibrary();
            this.ChangeCurrencyRates(currencyFrom, currencyTo);
        }
コード例 #2
0
ファイル: EmailAlertLibrary.cs プロジェクト: TT0101/CuMaster
        public ViewModels.EmailAlertViewModel GetEmailAlert(EmailAlertViewModel emailAlert)
        {
            CurrencyLibrary     cl           = new CurrencyLibrary();
            EmailAlertViewModel updatedAlert = emailAlert;

            updatedAlert.CurrenciesTo = cl.GetAllowedCurrenciesSelect(emailAlert.CurrencyFrom);
            return(updatedAlert);
        }
コード例 #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);
        }
コード例 #4
0
        public CurrencyConversionLibrary(Classes.Session.Session currentSession)
        {
            this.SetDefaults(currentSession);
            this.ValueFrom = 1;

            this.Currencies = new CurrencyLibrary();

            this.ChangeCurrencyRates(this.DefaultFromCurrency, this.DefaultToCurrency);
        }
コード例 #5
0
ファイル: RateTrendsLibrary.cs プロジェクト: TT0101/CuMaster
        public ViewModels.RateTrendsViewModel GetInitialRateSettings(Session session)
        {
            CurrencyLibrary cLib = new CurrencyLibrary();

            return(new ViewModels.RateTrendsViewModel
            {
                BaseCurrency = session.Defaults.DefaultCurrencyFrom,
                Currencies = cLib.CurrencyFromSelect,
                LengthSelected = 1
            });
        }
コード例 #6
0
ファイル: EmailAlertLibrary.cs プロジェクト: TT0101/CuMaster
        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
            });
        }
コード例 #7
0
        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)
            });
        }
コード例 #8
0
        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) ?? "")
            });
        }