Ejemplo n.º 1
0
        private static void AutoSendBirthdayCoupon()
        {
            var customer = new CustomerRepo().GetCustomers();
            var NowMonth = DateTime.Now.Month;

            foreach (var c in customer)
            {
                if (c.Birthday.Month == NowMonth)
                {
                    int result = _couponRepo.GetCouponByAcc(c.Account, 1);
                    if (result == 0)
                    {
                        _couponRepo.AddBirthdayCoupon(c.Account);
                    }
                }
            }
        }