コード例 #1
0
        public ActionResult AddCouponCategory(CouponCategory couponCategory)
        {
            string kstr      = "";
            bool   IsSuccess = true;

            if (string.IsNullOrEmpty(couponCategory.Name))
            {
                kstr      = "名称不能为空";
                IsSuccess = false;
            }
            if (string.IsNullOrEmpty(couponCategory.EnID))
            {
                kstr      = "英文标识不能为空";
                IsSuccess = false;
            }
            int _ExistPKID = manager.GetPKIDByEnID(couponCategory.EnID);

            if (_ExistPKID != 0)
            {
                if (couponCategory.PKID == 0)
                {
                    kstr      = "新增失败,该英文标识已存在";
                    IsSuccess = false;
                }
                else if (couponCategory.PKID != _ExistPKID)
                {
                    kstr      = "修改失败,该英文标识已存在";
                    IsSuccess = false;
                }
            }
            if (IsSuccess)
            {
                //为兼容老旧优惠券类型
                string _type = SelectDropDownList().Select("PKID = " + couponCategory.RuleID + "")[0]["Type"].ToString();

                if (string.IsNullOrEmpty(_type))
                {
                    couponCategory.CouponType = null;
                }
                else
                {
                    couponCategory.CouponType = System.Convert.ToInt32(_type);
                }

                if (couponCategory.PKID == 0)
                {
                    manager.AddCouponCategory(couponCategory);
                }
                else
                {
                    manager.UpdateCouponCategory(couponCategory);
                }
                return(RedirectToAction("CouponCategory"));
            }
            else
            {
                string js = "<script>alert(\"" + kstr + "\");location='CouponCategory';</script>";
                return(Content(js));
            }
        }
コード例 #2
0
        private bool HasRestrictions(Coupon coupon, TicketItem ticketItem)
        {
            Item item = Item.Get(ticketItem.ItemId);
            // Coupon Category Restrictions
            List <CouponCategory> cats = new List <CouponCategory>(CouponCategory.GetAll(coupon.Id));

            if ((cats.Count > 0) && coupon.IsExclusive &&
                CouponCategory.FindByCategoryId(cats, item.CategoryId) == null)
            {
                return(true);
            }
            if ((cats.Count > 0) && !coupon.IsExclusive &&
                CouponCategory.FindByCategoryId(cats, item.CategoryId) != null)
            {
                return(true);
            }
            // Coupon Item Restrictions
            List <CouponItem> items = new List <CouponItem>(CouponItem.GetAll(coupon.Id));

            if ((items.Count > 0) && coupon.IsExclusive &&
                CouponItem.FindByItemId(items, item.Id) == null)
            {
                return(true);
            }
            if ((items.Count > 0) && !coupon.IsExclusive &&
                CouponItem.FindByItemId(items, item.Id) != null)
            {
                return(true);
            }
            return(false);
        }
コード例 #3
0
        private void UpdateCouponCategories()
        {
            int[] currentCategoryIds = GetCategoryIds();
            if (EqualIdCollections(currentCategoryIds, _pendingCategoryIds))
            {
                return;
            }
            if (currentCategoryIds != null)
            {
                List <CouponCategory> couponCategories = new List <CouponCategory>(CouponCategory.GetAll(ActiveCoupon.Id));

                // Remove any in current, that doesn't exist in pending
                foreach (CouponCategory existing in
                         from id in currentCategoryIds
                         where _pendingCategoryIds == null || !_pendingCategoryIds.Any(testId => testId == id)
                         select CouponCategory.FindByCategoryId(couponCategories, id))
                {
                    CouponCategory.Delete(existing.Id);
                }
            }

            // Add any missing pending to the current
            if (_pendingCategoryIds == null)
            {
                return;
            }
            foreach (int id in _pendingCategoryIds
                     .Where(id => !(currentCategoryIds != null && currentCategoryIds.Any(testId => testId == id))))
            {
                // Add a new CouponCategory for this Coupon
                CouponCategory.Add(ActiveCoupon.Id, id);
            }
        }
コード例 #4
0
        private void UpdateCoupon()
        {
            if (editorControl.UpdateCoupon())
            {
                SetEditMode(false);
                if (listBox1.SelectedIndex >= 0)
                {
                    var item = (FormattedListBoxItem)listBox1.SelectedItem;
                    item.Set(editorControl.ActiveCoupon, editorControl.ActiveCoupon.Description);
                }
                else
                {
                    var listItem = new FormattedListBoxItem(
                        editorControl.ActiveCoupon,
                        editorControl.ActiveCoupon.Description, true);
                    listBox1.Items.Add(listItem);
                    listBox1.SelectedItem = listItem;
                    listBox1.ScrollIntoView(listItem);
                    buttonDelete.IsEnabled = true;
                }
            }
            if (editorControl.ActiveCoupon != null)
            {
                var couponCategories =
                    new List <CouponCategory>(CouponCategory.GetAll(editorControl.ActiveCoupon.Id));
                foreach (int id in editorControl.couponCategorySelectionControl.SelectedCategoryIds
                         .Where(id => CouponCategory.FindByCategoryId(couponCategories, id) == null))
                {
                    CouponCategory.Add(editorControl.ActiveCoupon.Id, id);
                }
                foreach (CouponCategory category in couponCategories
                         .Where(category => !editorControl.couponCategorySelectionControl.SelectedCategoryIds
                                .Contains(category.CategoryId)))
                {
                    CouponCategory.Delete(editorControl.ActiveCoupon.Id, category.CategoryId);
                }

                var couponItems =
                    new List <CouponItem>(CouponItem.GetAll(editorControl.ActiveCoupon.Id));
                foreach (int id in editorControl.couponItemSelectionControl.SelectedItemIds
                         .Where(id => CouponItem.FindByItemId(couponItems, id) == null))
                {
                    CouponItem.Add(editorControl.ActiveCoupon.Id, id);
                }
                foreach (CouponItem item in couponItems
                         .Where(item => !editorControl.couponCategorySelectionControl.SelectedCategoryIds
                                .Contains(item.ItemId)))
                {
                    CouponItem.Delete(editorControl.ActiveCoupon.Id, item.ItemId);
                }
            }
        }
コード例 #5
0
 public bool UpdateCouponCategory(CouponCategory entity)
 {
     try
     {
         _repository.Update(entity);
         return(true);
     }
     catch (Exception e)
     {
         _log.Error(e, "数据库操作出错");
         return(false);
     }
 }
コード例 #6
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            CouponCategory = await _context.CouponCategories.FirstOrDefaultAsync(m => m.Id == id);

            if (CouponCategory == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #7
0
        private int[] GetCategoryIds()
        {
            if (ActiveCoupon == null)
            {
                return(null);
            }
            IEnumerable <CouponCategory> categories = CouponCategory.GetAll(ActiveCoupon.Id);
            List <int> selected = categories.Select(category => category.CategoryId).ToList();

            if (selected.Count == 0)
            {
                return(null);
            }
            selected.Sort();
            return(selected.ToArray());
        }
コード例 #8
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            CouponCategory = await _context.CouponCategories.FindAsync(id);

            if (CouponCategory != null)
            {
                _context.CouponCategories.Remove(CouponCategory);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
コード例 #9
0
        public IActionResult OnGet(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            CouponCategory = _context.CouponCategories
                             .Include(cou => cou.Coupons)
                             .FirstOrDefault(cou => cou.Id == id);

            if (CouponCategory == null)
            {
                return(NotFound());
            }

            return(Page());
        }
コード例 #10
0
        public HttpResponseMessage Create(CategoryModel model)
        {
            var couponCategory = new CouponCategory
            {
                Name    = model.Name,
                Price   = model.Price,
                BrandId = model.BrandId,
                Count   = model.Count,
                ReMark  = model.ReMark,
                ClassId = model.ClassId,
                Intro   = model.Intro,
                Content = model.Content
            };

            if (_couponCategoryService.CreateCouponCategory(couponCategory))
            {
                return(PageHelper.toJson(PageHelper.ReturnValue(true, "数据添加成功")));
            }
            return(PageHelper.toJson(PageHelper.ReturnValue(false, "数据添加失败")));
        }
コード例 #11
0
        public ActionResult AddCouponCategory(int?id)
        {
            var _CouponTypeTable = SelectDropDownList();
            List <SelectListItem> _CouponTypeList = new List <SelectListItem>();

            if (_CouponTypeTable != null && _CouponTypeTable.Rows.Count > 0)
            {
                for (int i = 0; i < _CouponTypeTable.Rows.Count; i++)
                {
                    _CouponTypeList.Add(new SelectListItem {
                        Value = _CouponTypeTable.Rows[i]["PKID"].ToString(), Text = _CouponTypeTable.Rows[i]["Name"].ToString()
                    });
                }
            }

            ViewBag.CouponTypeList = _CouponTypeList;

            int _PKID = id.GetValueOrDefault(0);

            if (_PKID != 0)
            {
                ViewBag.Title = "修改红包分类";
                return(View(manager.GetCouponCategoryByID(_PKID)));
            }
            else
            {
                ViewBag.Title = "新增红包分类";
                CouponCategory _Model = new CouponCategory()
                {
                    PKID      = 0,
                    ValidDays = 7,
                    IsActive  = 0
                };
                return(View(_Model));
            }
        }
コード例 #12
0
        public ActionResult Coupon(int?CategoryID)
        {
            int _CategoryID = CategoryID.GetValueOrDefault(0);

            if (_CategoryID != 0)
            {
                CouponCategory _CouponCategory = manager.GetCouponCategoryByID(_CategoryID);
                if (_CouponCategory != null && _CouponCategory.PKID != 0)
                {
                    List <Coupon> _CouponList = manager.GetCouponByCategoryID(_CategoryID);
                    ViewBag.CouponCategory = _CouponCategory;
                    ViewBag.CouponList     = _CouponList;
                    return(View());
                }
                else
                {
                    return(Content("<script>alert('该分类不存在,请从正常来源进入');location='/Coupon/CouponCategory'</script>"));
                }
            }
            else
            {
                return(Content("<script>alert('该分类不存在,请从正常来源进入');location='/Coupon/CouponCategory'</script>"));
            }
        }
コード例 #13
0
        public async Task <IActionResult> Edit(string id, CouponViewModel viewModel)
        {
            #region SelectList
            var users = await _db.UserRepository.GetAsync();

            ViewData["UsersId"] = new SelectList(users, "Id", "UserName");

            var products = await _db.ProductRepository.GetAsync();

            ViewData["ProductsId"] = new SelectList(products, "Id", "Name");

            var categories = await _db.CategoryRepository.GetAsync();

            ViewData["CategoriesId"] = new SelectList(categories, "Id", "Name");
            #endregion
            if (ModelState.IsValid)
            {
                viewModel.Title = viewModel.Title.Trim();
                var couponModel = await _db.CouponRepository.GetAsync(c => c.Title == viewModel.Title.Trim() && c.Id != id, string.Empty);

                if (couponModel == null)
                {
                    var coupon = await _db.CouponRepository.GetAsync(id);

                    if (coupon != null)
                    {
                        if (viewModel.EndDateLimit < viewModel.StartDateLimit)
                        {
                            ModelState.AddModelError("EndDateLimit", "تاریخ پایان باید بعد از تاریخ شروع باشد");
                            return(View(viewModel));
                        }

                        if (viewModel.HasUserLimit && viewModel.Users.Count == 0)
                        {
                            ModelState.AddModelError("Users", "کاربران را وارد کنید");
                            return(View(viewModel));
                        }

                        if (viewModel.HasProductOrCategoryLimit)
                        {
                            if (viewModel.ProductOrCategoryLimit == "product" && viewModel.Products.Count == 0)
                            {
                                ModelState.AddModelError("Products", "محصولات را وارد کنید");
                                return(View(viewModel));
                            }

                            if (viewModel.ProductOrCategoryLimit == "category" && viewModel.Categories.Count == 0)
                            {
                                ModelState.AddModelError("Categories", "دسته بندی ها را وارد کنید");
                                return(View(viewModel));
                            }
                        }

                        #region Coupon
                        coupon.Title         = viewModel.Title.Trim();
                        coupon.Type          = viewModel.Type == "percent" ? true : false;
                        coupon.Value         = viewModel.Type == "percent" ? viewModel.PercentDiscount : viewModel.ValueDiscount;
                        coupon.HasCountLimit = viewModel.HasCountLimit;
                        if (viewModel.HasCountLimit)
                        {
                            coupon.CountLimit = viewModel.CountLimit;
                        }
                        coupon.HasDateLimit = viewModel.HasDateLimit;
                        if (viewModel.HasDateLimit)
                        {
                            coupon.StartDateLimit = viewModel.StartDateLimit;
                            coupon.EndDateLimit   = viewModel.EndDateLimit;
                        }
                        coupon.HasUserLimit = viewModel.HasUserLimit;
                        if (viewModel.HasProductOrCategoryLimit)
                        {
                            if (viewModel.ProductOrCategoryLimit == "product")
                            {
                                coupon.HasProductLimit  = true;
                                coupon.HasCategoryLimit = false;
                            }
                            else
                            {
                                coupon.HasCategoryLimit = true;
                                coupon.HasProductLimit  = false;
                            }
                        }
                        else
                        {
                            coupon.HasProductLimit  = false;
                            coupon.HasCategoryLimit = false;
                        }
                        #endregion

                        _db.CouponRepository.Update(coupon);
                        await _db.SaveAsync();

                        if (viewModel.HasUserLimit)
                        {
                            var oldUsers = await _db.CouponUserRepository.GetAsync(c => c.CouponId == coupon.Id, null, string.Empty);

                            foreach (var oldUser in oldUsers)
                            {
                                _db.CouponUserRepository.Delete(oldUser);
                            }
                            foreach (var userId in viewModel.Users)
                            {
                                var couponUser = new CouponUser()
                                {
                                    CouponId = coupon.Id,
                                    UserId   = userId
                                };
                                await _db.CouponUserRepository.AddAsync(couponUser);
                            }
                            await _db.SaveAsync();
                        }
                        if (viewModel.HasProductOrCategoryLimit)
                        {
                            if (viewModel.ProductOrCategoryLimit == "product")
                            {
                                var oldProducts = await _db.CouponProductRepository.GetAsync(c => c.CouponId == coupon.Id, null, string.Empty);

                                foreach (var oldProduct in oldProducts)
                                {
                                    _db.CouponProductRepository.Delete(oldProduct);
                                }
                                foreach (var productId in viewModel.Products)
                                {
                                    var couponProduct = new CouponProduct()
                                    {
                                        CouponId  = coupon.Id,
                                        ProductId = productId
                                    };
                                    await _db.CouponProductRepository.AddAsync(couponProduct);
                                }
                                await _db.SaveAsync();
                            }
                            else
                            {
                                var oldCategories = await _db.CouponCategoryRepository.GetAsync(c => c.CouponId == coupon.Id, null, string.Empty);

                                foreach (var oldCategory in oldCategories)
                                {
                                    _db.CouponCategoryRepository.Delete(oldCategory);
                                }
                                foreach (var categoryId in viewModel.Categories)
                                {
                                    var couponCategory = new CouponCategory()
                                    {
                                        CouponId   = coupon.Id,
                                        CategoryId = categoryId
                                    };
                                    await _db.CouponCategoryRepository.AddAsync(couponCategory);
                                }
                                await _db.SaveAsync();
                            }
                        }

                        return(Redirect("/Admin/Coupon"));
                    }
                    else
                    {
                        return(NotFound());
                    }
                }
                else
                {
                    ModelState.AddModelError("Title", "کد تخفیف با این نام قبلا ثبت شده است");
                    return(View(viewModel));
                }
            }
            else
            {
                return(View(viewModel));
            }
        }
コード例 #14
0
ファイル: DalCoupon.cs プロジェクト: hujie0419/springbootdemo
        public static void UpdateCouponCategory(SqlConnection connection, CouponCategory couponCategory)
        {
            var sqlParamters = new[]
            {
                new SqlParameter("@PKID", couponCategory.PKID),
                new SqlParameter("@EnID", couponCategory.EnID),
                new SqlParameter("@Name", couponCategory.Name ?? string.Empty),
                new SqlParameter("@Description", couponCategory.Description ?? string.Empty),
                new SqlParameter("@Title", couponCategory.Title ?? string.Empty),
                new SqlParameter("@Text", couponCategory.Text ?? string.Empty),
                new SqlParameter("@Picture", couponCategory.Picture ?? string.Empty),
                new SqlParameter("@ValidDays", couponCategory.ValidDays),
                new SqlParameter("@IsActive", couponCategory.IsActive),
                new SqlParameter("@Percentage", couponCategory.Percentage),
                new SqlParameter("@CouponType", couponCategory.CouponType ?? null),
                new SqlParameter("@RuleID", couponCategory.RuleID ?? null),
                new SqlParameter("@Remark", couponCategory.Remark ?? string.Empty),
                new SqlParameter("@Platform", couponCategory.Platform ?? string.Empty),
                new SqlParameter("@BackImage", couponCategory.BackImage ?? string.Empty),
                new SqlParameter("@ContentImage", couponCategory.ContentImage ?? string.Empty),
                new SqlParameter("@BackgroundImage", couponCategory.BackgroundImage ?? string.Empty),
                new SqlParameter("@SpinImage", couponCategory.SpinImage ?? string.Empty),
                new SqlParameter("@AndroidCommunicationValue", couponCategory.AndroidCommunicationValue ?? string.Empty),
                new SqlParameter("@AndroidDisposeValue", couponCategory.AndroidDisposeValue ?? string.Empty),
                new SqlParameter("@AppLink", couponCategory.AppLink ?? string.Empty),
                new SqlParameter("@CouponDescriptionStatus", couponCategory.CouponDescriptionStatus),
                new SqlParameter("@GetCouponDescription", couponCategory.GetCouponDescription ?? string.Empty),
                new SqlParameter("@IOSCommunicationValue", couponCategory.IOSCommunicationValue ?? string.Empty),
                new SqlParameter("@IOSDisposeValue", couponCategory.IOSDisposeValue ?? string.Empty),
                new SqlParameter("@RoamingDescription", couponCategory.RoamingDescription ?? string.Empty)
            };
            const string sql = @"UPDATE  tbl_CouponCategory
                                SET     EnID = @EnID ,
                                        Name = @Name ,
                                        Description = @Description ,
                                        Title = @Title ,
                                        Text = @Text ,
                                        Picture = @Picture ,
                                        ValidDays = @ValidDays ,
                                        IsActive = @IsActive ,
                                        Percentage = @Percentage ,
                                        CouponType = @CouponType ,
                                        RuleID = @RuleID ,
                                        Remark = @Remark ,
                                        Platform = @Platform ,
                                        BackImage = @BackImage ,
                                        ContentImage = @ContentImage ,
                                        BackgroundImage = @BackgroundImage ,
                                        SpinImage = @SpinImage,
                                        IOSDisposeValue = @IOSDisposeValue,
                                        AndroidDisposeValue = @AndroidDisposeValue ,
                                        IOSCommunicationValue = @IOSCommunicationValue,
                                        AndroidCommunicationValue= @AndroidCommunicationValue ,
                                        AppLink = @AppLink  ,
                                        GetCouponDescription= @GetCouponDescription ,
                                        CouponDescriptionStatus= @CouponDescriptionStatus ,
                                        RoamingDescription= @RoamingDescription	
                                WHERE   PKID = @PKID";

            SqlHelper.ExecuteNonQuery(connection, CommandType.Text, sql, sqlParamters);
        }
コード例 #15
0
        private void InitializeAvailableCoupons()
        {
            List <Coupon>         allCoupons    = new List <Coupon>(Coupon.GetAll());
            List <CouponCategory> allCategories = new List <CouponCategory>(CouponCategory.GetAll());
            List <CouponItem>     allItems      = new List <CouponItem>(CouponItem.GetAll());

            listBoxAvailable.Items.Clear();
            foreach (Coupon coupon in allCoupons)
            {
                if (!coupon.IsActive)
                {
                    continue;
                }
                List <CouponCategory> couponCategories =
                    new List <CouponCategory>(CouponCategory.FindAllByCouponId(allCategories, coupon.Id));
                List <CouponItem> couponItems =
                    new List <CouponItem>(CouponItem.FindAllByCouponId(allItems, coupon.Id));

                // Check for applied coupons and exclude them
                if ((from FormattedListBoxItem item in listBoxApplied.Items
                     select(Coupon) item.ReferenceObject)
                    .Any(appliedCoupon => appliedCoupon.Id == coupon.Id))
                {
                    continue;
                }

                // Add applicable coupons
                bool add = false;
                if (coupon.ApplyToAll)
                {
                    add = true;
                }
                else if ((SelectedTicketItem == null) && (couponItems.Count == 0) && (couponCategories.Count == 0))
                {
                    add = true;
                }
                else if (SelectedTicketItem != null)
                {
                    Category category = Category.Get(SelectedItem.CategoryId);
                    if (coupon.IsExclusive)
                    {
                        HasRestrictions(coupon, SelectedTicketItem);

                        if (couponItems.Any(couponItem => SelectedTicketItem.ItemId == couponItem.ItemId))
                        {
                            add = true;
                        }
                        if (couponCategories.Any(couponCategory => category.Id == couponCategory.CategoryId))
                        {
                            add = true;
                        }
                    }
                    else
                    {
                        bool found = couponItems.Any(couponItem => SelectedTicketItem.ItemId == couponItem.ItemId) ||
                                     couponCategories.Any(couponCategory => category.Id == couponCategory.CategoryId);
                        if (!found)
                        {
                            add = true;
                        }
                    }
                }
                if (add)
                {
                    AddAvailable(coupon);
                }
            }
        }
コード例 #16
0
 public void AddCouponCategory(CouponCategory couponCategory)
 {
     handler.AddCouponCategory(couponCategory);
 }
コード例 #17
0
        public void UpdateCouponCategory(CouponCategory couponCategory)
        {
            Action <SqlConnection> action = (connection) => DalCoupon.UpdateCouponCategory(connection, couponCategory);

            dbManager.Execute(action);
        }
コード例 #18
0
ファイル: DalCoupon.cs プロジェクト: hujie0419/springbootdemo
        public static void AddCouponCategory(SqlConnection connection, CouponCategory couponCategory)
        {
            var sqlParamters = new[]
            {
                new SqlParameter("@EnID", couponCategory.EnID),
                new SqlParameter("@Name", couponCategory.Name ?? string.Empty),
                new SqlParameter("@Description", couponCategory.Description ?? string.Empty),
                new SqlParameter("@Title", couponCategory.Title ?? string.Empty),
                new SqlParameter("@Text", couponCategory.Text ?? string.Empty),
                new SqlParameter("@Picture", couponCategory.Picture ?? string.Empty),
                new SqlParameter("@ValidDays", couponCategory.ValidDays),
                new SqlParameter("@IsActive", couponCategory.IsActive),
                new SqlParameter("@Percentage", couponCategory.Percentage),
                new SqlParameter("@CouponType", couponCategory.CouponType ?? null),
                new SqlParameter("@RuleID", couponCategory.RuleID ?? null),
                new SqlParameter("@Remark", couponCategory.Remark ?? string.Empty),
                new SqlParameter("@Platform", couponCategory.Platform ?? string.Empty),
                new SqlParameter("@BackImage", couponCategory.BackImage ?? string.Empty),
                new SqlParameter("@ContentImage", couponCategory.ContentImage ?? string.Empty),
                new SqlParameter("@BackgroundImage", couponCategory.BackgroundImage ?? string.Empty),
                new SqlParameter("@SpinImage", couponCategory.SpinImage ?? string.Empty),
                new SqlParameter("@AndroidCommunicationValue", couponCategory.AndroidCommunicationValue ?? string.Empty),
                new SqlParameter("@AndroidDisposeValue", couponCategory.AndroidDisposeValue ?? string.Empty),
                new SqlParameter("@AppLink", couponCategory.AppLink ?? string.Empty),
                new SqlParameter("@CouponDescriptionStatus", couponCategory.CouponDescriptionStatus),
                new SqlParameter("@GetCouponDescription", couponCategory.GetCouponDescription ?? string.Empty),
                new SqlParameter("@IOSCommunicationValue", couponCategory.IOSCommunicationValue ?? string.Empty),
                new SqlParameter("@IOSDisposeValue", couponCategory.IOSDisposeValue ?? string.Empty),
                new SqlParameter("@RoamingDescription", couponCategory.RoamingDescription ?? string.Empty)
            };

            const string sql = @"INSERT   INTO tbl_CouponCategory
                                        ( EnID ,
                                          Name ,
                                          Description ,
                                          Title ,
                                          Text ,
                                          Picture ,
                                          ValidDays ,
                                          IsActive ,
                                          Percentage ,
                                          CouponType ,
                                          RuleID ,
                                          Remark ,
                                          Platform ,
                                          BackImage ,
                                          ContentImage ,
                                          BackgroundImage ,
                                          SpinImage ,
                                          IOSDisposeValue ,
                                          AndroidDisposeValue ,
                                          IOSCommunicationValue ,
                                          AndroidCommunicationValue ,
                                          AppLink ,
                                          GetCouponDescription ,
                                          CouponDescriptionStatus ,
                                          RoamingDescription		                    
                                        )
                               VALUES   ( @EnID ,
                                          @Name ,
                                          @Description ,
                                          @Title ,
                                          @Text ,
                                          @Picture ,
                                          @ValidDays ,
                                          @IsActive ,
                                          @Percentage ,
                                          @CouponType ,
                                          @RuleID ,
                                          @Remark ,
                                          @Platform ,
                                          @BackImage ,
                                          @ContentImage ,
                                          @BackgroundImage ,
                                          @SpinImage ,
                                          @IOSDisposeValue ,
                                          @AndroidDisposeValue ,
                                          @IOSCommunicationValue ,
                                          @AndroidCommunicationValue ,
                                          @AppLink ,
                                          @GetCouponDescription ,
                                          @CouponDescriptionStatus ,
                                          @RoamingDescription		
                                        )";

            SqlHelper.ExecuteNonQuery(connection, CommandType.Text, sql, sqlParamters);
        }
コード例 #19
0
 public void UpdateCouponCategory(CouponCategory couponCategory)
 {
     handler.UpdateCouponCategory(couponCategory);
 }
コード例 #20
0
 private int[] GetCategoryIds(Coupon value)
 {
     return(CouponCategory.GetAll(value.Id).Select(item => item.CategoryId).ToArray());
 }