Ejemplo n.º 1
0
 protected void popTree_Selected(object sender, PopupTreeView.TreeNodeSelectedArgs args)
 {
     foreach (var altId in args.SelectedValues)
     {
         ProductService.AddRelatedProduct(ProductID, SQLDataHelper.GetInt(altId), (RelatedType)RelatedType);
     }
     popTree.UpdateTree(ProductService.GetRelatedProducts(ProductID, (RelatedType)RelatedType).Select(rp => rp.ProductId));
 }
Ejemplo n.º 2
0
 protected void popTree_Selected(object sender, PopupTreeView.TreeNodeSelectedArgs args)
 {
     ViewState["SelectedCategories"] = args.SelectedValues.Select(val => int.Parse(val)).ToList();
     if (args.SelectedValues.Any())
     {
         lCategories.Text = args.SelectedValues.Count() + " " + Resource.Admin_Coupon_Categories;
     }
     else
     {
         lCategories.Text = Resource.Admin_Coupon_AllCategories;
     }
 }
Ejemplo n.º 3
0
        protected void popTree_Selected(object sender, PopupTreeView.TreeNodeSelectedArgs args)
        {
            if (_typeFlag == ProductOnMain.TypeFlag.None)
            {
                return;
            }

            foreach (var altId in args.SelectedValues)
            {
                ProductOnMain.AddProductByType(SQLDataHelper.GetInt(altId), _typeFlag);
            }
            popTree.UpdateTree(ProductOnMain.GetProductIdByType(_typeFlag));
        }
Ejemplo n.º 4
0
        protected void pTreeProduct_NodeSelected(object sender, PopupTreeView.TreeNodeSelectedArgs args)
        {
            var items = new List <OrderItem>();

            foreach (var val in args.SelectedValues)
            {
                int treeSelectedValue;
                int.TryParse(val, out treeSelectedValue);
                var product = ProductService.GetProduct(SQLDataHelper.GetInt(treeSelectedValue));
                items.Add(new OrderItem
                {
                    Name            = product.Name,
                    Price           = product.Offers[0].Price * (100 - Math.Max(product.Discount, GroupDiscount)) / 100,
                    SupplyPrice     = product.Offers[0].SupplyPrice,
                    ProductID       = product.ProductId,
                    Amount          = 1,
                    ArtNo           = product.ArtNo,
                    IsCouponApplied = CouponCode.IsNotEmpty() && CouponService.GetCouponByCode(CouponCode) != null && CouponService.IsCouponAppliedToProduct(CouponService.GetCouponByCode(CouponCode).CouponID, product.ProductId),
                    Weight          = product.Weight,
                    PhotoID         = product.ProductPhotos.OrderByDescending(p => p.Main).FirstOrDefault() != null
                                ? product.ProductPhotos.OrderByDescending(p => p.Main).FirstOrDefault().PhotoId
                                : (int?)null
                });
            }

            if (OrderItems == null)
            {
                OrderItems = new List <OrderItem>();
            }

            foreach (var item in items)
            {
                item.OrderItemID     = GenItemId();
                item.SelectedOptions = new List <EvaluatedCustomOptions>();
                if (OrderItems.Contains(item))
                {
                    OrderItems[OrderItems.IndexOf(item)].Amount += 1;
                }
                else
                {
                    OrderItems.Add(item);
                }
            }
            LoadProducts();
            ItemsUpdated(this, new EventArgs());
            pTreeProduct.UnSelectAll();
            pTreeProduct.Hide();
        }
Ejemplo n.º 5
0
 protected void popTree_TreeNodeSelected(object sender, PopupTreeView.TreeNodeSelectedArgs args)
 {
     lblParentName.Text = args.SelectedTexts[0];
     hfParentId.Value   = args.SelectedValues[0];
 }