Example #1
0
 public void AddTicketDiscount(DiscountType type, decimal amount, int userId)
 {
     var c = Discounts.SingleOrDefault(x => x.DiscountType == (int)type);
     if (c == null)
     {
         c = new Discount { DiscountType = (int)type, Amount = amount };
         Discounts.Add(c);
     }
     if (amount == 0) Discounts.Remove(c);
     c.UserId = userId;
     c.Amount = amount;
 }
Example #2
0
 public DiscountViewModel(Discount model)
 {
     Model = model;
 }