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); }
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); } } }