Пример #1
0
        public static DiscountCard GetDiscount(string codebar)
        {
            var discountCard = RepositoryDiscountCard.GetOneByNumber(codebar);

            if (discountCard != null && discountCard.IsActive)
            {
                Client.Barcode = codebar;
                Client.Points  = discountCard.Points;
                Client.InfoClientsCustomerId = discountCard.InfoClientsCustomerId;
                Client.Procent     = 0;
                Client.LastDateUpd = discountCard.DateTimeLastAddProduct;
            }

            return(discountCard);
        }
Пример #2
0
        public static void SetDiscountPoint(string codebar, int points, bool isSet)
        {
            var discountCard = RepositoryDiscountCard.GetOneByNumber(codebar);

            if (discountCard != null)
            {
                if (points >= Client.MaxPoints)
                {
                    points = Client.MaxPoints;
                }
                discountCard.Points = isSet ? points : discountCard.Points;

                if (isSet)
                {
                    RepositoryDiscountCard.Update(discountCard);
                }
            }
        }