public static bool Delete(string couponId) { if (DataValidator.IsValidId(couponId) && dal.Delete(couponId)) { CouponItem.Delete(couponId); return(true); } return(false); }
private static void CreateCoupon(CouponInfo couponInfo, int userId) { string randStringByPattern = RandomManage.GetRandStringByPattern(couponInfo.CouponNumPattern); CouponItemInfo couponItemInfo = new CouponItemInfo(); couponItemInfo.CouponId = couponInfo.CouponId; couponItemInfo.CouponNum = randStringByPattern; couponItemInfo.UserId = userId; couponItemInfo.OrderId = 0; CouponItem.Add(couponItemInfo); }