示例#1
0
 public static double GetCurrency(Iso4217 to)
 {
     if (to != from)
     {
         return(Provider.Google.Rate(from, to) / 10000);
     }
     return(1);
 }
 public PartialViewResult GetMovieDetails(int?id, Iso4217 currency)
 {
     return(PartialView("PartialMovieDetailsView",
                        new PartialMovieDetailsViewModel()
     {
         Movie = _movieServiceGateway.Read(id.Value),
         CurrentCurrency = currency
     }));
 }
        public PartialViewResult GetMoviesResult(int?id, Iso4217 currency)
        {
            if (id == null)
            {
                return(PartialView("PartialMovieView",
                                   new PartialViewModel()
                {
                    Movies = _movieServiceGateway.ReadAll(),
                    CurrentCurrency = currency
                }));
            }
            var genre = _genreServiceGateway.Read(id.Value);

            foreach (var movie in genre.Movies)
            {
                movie.Genre = genre;
            }
            return(PartialView("PartialMovieView", new PartialViewModel()
            {
                Movies = genre.Movies,
                CurrentCurrency = currency
            }));
        }
示例#4
0
        /// <exclude />
        public static double Convert(this Provider provider, Iso4217 source, Iso4217 quote, double value)
        {
            var rate = Factory.Make(provider).Fetch(source, quote);

            return(new Calc(rate, value).Result);
        }
示例#5
0
 /// <exclude />
 public static double Rate(this Provider provider, Iso4217 source, Iso4217 quote)
 {
     return(Factory.Make(provider).Fetch(source, quote).Value);
 }
示例#6
0
 /// <exclude />
 public static Rate Fetch(this Provider provider, Iso4217 source, Iso4217 quote)
 {
     return(Factory.Make(provider).Fetch(source, quote));
 }
示例#7
0
 /// <exclude />
 public Rate Fetch(Iso4217 source, Iso4217 quote)
 {
     return(Fetch(new Pair(source.ToString(), quote.ToString())));
 }