public static void CreateDiscount(DiscountTypes discount, int subTypes, Decimal amount, DateTime expiryDate, String voucherCode, int chargeType, int showId) { ShowDiscounts showDiscount = new ShowDiscounts(); showDiscount.Amount = amount; showDiscount.DiscountType = (int)discount; showDiscount.Subtype = (int)subTypes; showDiscount.VoucherCode = voucherCode; showDiscount.ChargeType = chargeType; showDiscount.Showid = showId; showDiscount.Save(); }
public JsonResult AddShowDiscounts(DiscountChargesDto DiscountCharges) { ShowDiscounts sc = new ShowDiscounts(DiscountCharges.ClsId); sc.DiscountType = DiscountCharges.DiscountId; sc.Subtype = DiscountCharges.SubTypes; sc.ChargeType = DiscountCharges.ChargeTypeId; sc.Amount = DiscountCharges.Amount; sc.Showid = DiscountCharges.ShowId; return Json(new { Status = 0, ClsId = sc.Save() }); }
public ShowDiscounts(ShowDiscounts copy) { _showDiscounts = new Fpp.Data.ShowDiscounts(ModuleSettings); Amount = copy.Amount; DiscountType = copy.DiscountType; Subtype = copy.Subtype; VoucherCode = copy.VoucherCode; ChargeType = copy.ChargeType; Showid = copy.Showid; Save(); }
private List<Core.Models.CopyValue> CreateDiscountTypes(int oldid, int newid, List<Core.Models.CopyValue> showChargeMap) { List<Core.Models.CopyValue> res = new List<Core.Models.CopyValue>(); List<ShowDiscounts> srcClassTypesList = ShowDiscounts.getClassChargeDetails(oldid); foreach (ShowDiscounts item in srcClassTypesList) { item.Showid = newid; var t = showChargeMap.Where(x => x.oldValue == item.ChargeType); if (t != null && t.Count() > 0) { item.ChargeType = t.First().newValue; var tmp = new ShowDiscounts(item); res.Add(new Core.Models.CopyValue(item.ID, tmp.ID)); } } return res; }