Пример #1
0
        //Конструктор
        public ComputerShop()
        {
            customers   = new Dictionary <string, Customer>();
            cards       = new List <Card>();
            curCustomer = null;

            cards.Add(new Card());

            curDate      = GeneralDate.Instance().Date;
            cheerfulDays = new SortedSet <int>();
            setCheerfulDays();
            customerKey = "";
        }
Пример #2
0
        /// Проверка наступления нового месяца
        public bool checkNewMonth()
        {
            DateTime lastDate = curDate;

            curDate = GeneralDate.Instance().Date;

            if (curDate > lastDate && curDate.Month != lastDate.Month)
            {
                setCheerfulDays();
                return(true);
            }

            return(false);
        }
Пример #3
0
 //True, если нужно заменить
 public override bool IsChanging(Shop.Customer owner)
 {
     return(GeneralDate.Instance().Date >= changeDate);
 }
Пример #4
0
        DateTime changeDate; //Дата замены карты

        //Конструктор
        public QuantumCard() : base()
        {
            discount   = DiscountConst.QuantumDiscount;
            name       = "quantum discount card";
            changeDate = GeneralDate.Instance().Date.AddDays(DiscountConst.QuantumDaysLimit);
        }