示例#1
0
 public Klant(KlantType type, string naam, string btwNummer, string adres)
 {
     Type      = type;
     Naam      = naam;
     BtwNummer = btwNummer;
     Adres     = adres;
 }
示例#2
0
 public NieuweKlantPage()
 {
     InitializeComponent();
     rm = new ReservatieManager(new UnitOfWork(new ReservatieContext()));
     foreach (var value in KlantType.GetValues(typeof(KlantType)))
     {
         if (!comboBoxType.Items.Contains(value.ToString()))
         {
             comboBoxType.Items.Add(value.ToString());
         }
     }
 }
示例#3
0
 public Klant(int klantNummer, KlantType type, string naam, string voorNaam, string btwNummer, string gemeente, string postCode, string straat, string huisNummer, string busNr, int aantalReservatiesDitJaar)
 {
     KlantID    = klantNummer;
     Type       = type;
     Naam       = naam;
     VoorNaam   = voorNaam;
     BtwNummer  = btwNummer;
     Gemeente   = gemeente;
     PostCode   = postCode;
     Straat     = straat;
     HuisNummer = huisNummer;
     BusNr      = busNr;
     AantalReservatiesDitJaar = aantalReservatiesDitJaar;
 }
        private decimal GetDiscount(KlantType klantType)
        {
            decimal discount = 0;

            //ToDo: Get aantal reservaties dit jaar + add Jaartal in param
            int aantalReservaties = 0;

            if (klantType == KlantType.Vip)
            {
                if (aantalReservaties >= 2)
                {
                    discount = 5;
                }
                if (aantalReservaties >= 7)
                {
                    discount = 7.5M;
                }
                if (aantalReservaties >= 15)
                {
                    discount = 10;
                }
            }
            else if (klantType == KlantType.Planner)
            {
                if (aantalReservaties >= 5)
                {
                    discount = 7.5M;
                }
                if (aantalReservaties >= 10)
                {
                    discount = 10;
                }
                if (aantalReservaties >= 15)
                {
                    discount = 12.50M;
                }
                if (aantalReservaties >= 20)
                {
                    discount = 15;
                }
                if (aantalReservaties >= 25)
                {
                    discount = 25;
                }
            }
            //else discount = 0

            return(discount);
        }
        private decimal GetDiscount(KlantType klantType, string klantNaam, DateTime year)
        {
            decimal discount = 0;

            int aantalReservaties = uow.Reservaties.ZoekReservatiesVanJaartal(klantNaam, year);

            if (klantType == KlantType.Vip)
            {
                if (aantalReservaties >= 2)
                {
                    discount = 5;
                }
                if (aantalReservaties >= 7)
                {
                    discount = 7.5M;
                }
                if (aantalReservaties >= 15)
                {
                    discount = 10;
                }
            }
            else if (klantType == KlantType.Planner)
            {
                if (aantalReservaties >= 5)
                {
                    discount = 7.5M;
                }
                if (aantalReservaties >= 10)
                {
                    discount = 10;
                }
                if (aantalReservaties >= 15)
                {
                    discount = 12.50M;
                }
                if (aantalReservaties >= 20)
                {
                    discount = 15;
                }
                if (aantalReservaties >= 25)
                {
                    discount = 25;
                }
            }
            //else discount = 0

            return(discount);
        }