Ejemplo n.º 1
0
 public static double GetCurrency(Iso4217 to)
 {
     if (to != from)
     {
         return(Provider.Google.Rate(from, to) / 10000);
     }
     return(1);
 }
Ejemplo n.º 2
0
 public PartialViewResult GetMovieDetails(int?id, Iso4217 currency)
 {
     return(PartialView("PartialMovieDetailsView",
                        new PartialMovieDetailsViewModel()
     {
         Movie = _movieServiceGateway.Read(id.Value),
         CurrentCurrency = currency
     }));
 }
Ejemplo n.º 3
0
        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
            }));
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
 /// <exclude />
 public static double Rate(this Provider provider, Iso4217 source, Iso4217 quote)
 {
     return(Factory.Make(provider).Fetch(source, quote).Value);
 }
Ejemplo n.º 6
0
 /// <exclude />
 public static Rate Fetch(this Provider provider, Iso4217 source, Iso4217 quote)
 {
     return(Factory.Make(provider).Fetch(source, quote));
 }
Ejemplo n.º 7
0
 /// <exclude />
 public Rate Fetch(Iso4217 source, Iso4217 quote)
 {
     return(Fetch(new Pair(source.ToString(), quote.ToString())));
 }