Example #1
0
        /// <summary>
        /// ValutaNaarEuro
        /// </summary>
        /// <param name="bedrag"></param>
        /// <param name="muntsoort"></param>
        /// <returns></returns>
        public decimal ValutaNaarEuro(decimal bedrag, Muntsoort muntsoort)
        {
            switch (muntsoort)
            {
            case Muntsoort.Onbekend:
            {
                throw new OnbekendeValuteExceptie();
            }

            case Muntsoort.Euro:
            {
                return(bedrag);
            }

            case Muntsoort.Gulden:
            {
                var euro = GuldenNaarEuro(bedrag);
                return(EuroNaarGulden(euro));
            }

            case Muntsoort.Dukaat:
            {
                var euro = DukaatNaarEuro(bedrag);
                return(EuroNaarDukaat(euro));
            }

            case Muntsoort.Florijn:
            {
                var euro = FlorijnNaarEuro(bedrag);
                return(EuroNaarFlorijn(euro));
            }
            }
            throw new OnbekendeValuteExceptie();
        }
Example #2
0
        public decimal ConvertTo(Muntsoort omrekenMuntsoort)
        {
            switch (omrekenMuntsoort)
            {
            case Muntsoort.Dukaat:
                return(Math.Round(ConvertToGulden() * 0.196078431372549M, 2));

            case Muntsoort.Euro:
                return(Math.Round(ConvertToGulden() * 0.45378M, 2));

            case Muntsoort.Florijn:
                return(Math.Round(ConvertToGulden() * 1.00M, 2));

            case Muntsoort.Gulden:
                return(Math.Round(ConvertToGulden(), 2));

            default:
                return(Bedrag);
            }
        }
Example #3
0
 public Valuta(Muntsoort type) : this(type, 10M)
 {
 }
Example #4
0
 public Valuta(Muntsoort type, decimal startBedrag)
 {
     Type   = type;
     Bedrag = startBedrag;
 }
Example #5
0
 public Valuta(decimal bedrag, Muntsoort muntsoort)
 {
     this._bedrag    = bedrag;
     this._muntsoort = muntsoort;
 }
Example #6
0
 /// <summary>
 /// Geld Constructor, ontvangt bedrag en muntsoort
 /// </summary>
 /// <param name="bedrag">bedrag als decimal</param>
 /// <param name="muntsoort">muntsoort als Muntsoort</param>
 public Geld(decimal bedrag, Muntsoort muntsoort)
 {
     _muntsoort     = muntsoort;
     _geldConverter = new GeldConverter();
     _bedrag        = _geldConverter.ValutaNaarEuro(bedrag, _muntsoort);
 }