protected void gvRelatedProductSelector_OnRowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "select":

                var rule    = OfferService.GetOfferRuleById(QueryOfferRuleId);
                var product = ProductService.GetProductById(Convert.ToInt32(e.CommandArgument.ToString()));

                if (product != null && rule != null)
                {
                    var relatedItem = new OfferRelatedItem
                    {
                        OfferRuleId = rule.Id,
                        ProductId   = product.Id,
                        Enabled     = true,
                        Priority    = 0
                    };

                    OfferService.InsertOfferRelatedItem(relatedItem);
                    LoadProductsForRelatedProductSelector();
                }

                break;
            }

            hfCurrentPanel.Value = "relatedProducts";
        }
Ejemplo n.º 2
0
        public int InsertOfferRelatedItem(OfferRelatedItem item)
        {
            int id = _offerRelatedItemRepository.Create(item);

            return(id);
        }
Ejemplo n.º 3
0
 public void UpdateOfferRelatedItem(OfferRelatedItem relatedItem)
 {
     _offerRelatedItemRepository.Update(relatedItem);
 }