Example #1
0
        public async Task AddWithMeta(WpPosts post, string articul, string charasteristics, string description, string discount, string price)
        {
            await Add(post);

            await AddMeta(post.Id, "articul", articul);
            await AddMeta(post.Id, "charasteristics", charasteristics);
            await AddMeta(post.Id, "description", description);
            await AddMeta(post.Id, "discount", discount);
            await AddMeta(post.Id, "price", price);
        }
Example #2
0
        public override async Task Add(WpPosts entity)
        {
            entity.PostType            = "product";
            entity.MenuOrder           = 0;
            entity.PostParent          = 0;
            entity.PostContentFiltered = string.Empty;
            entity.ToPing      = string.Empty;
            entity.Pinged      = string.Empty;
            entity.PostExcerpt = string.Empty;

            await base.Add(entity);
        }
Example #3
0
        public async Task AddWithMeta(WpPosts post, string articul, string charasteristics, string description, string discount, string price, IList <ulong> categoryIds)
        {
            await AddWithMeta(
                post,
                articul,
                charasteristics,
                description,
                discount,
                price
                );

            foreach (var id in categoryIds)
            {
                await AddCategoryToPost(post.Id, id);
            }
        }
Example #4
0
        private async void AddProduct_Click(object sender, RoutedEventArgs e)
        {
            WpPosts product = new WpPosts()
            {
                PostContent = prodContent.Text,
                PostName    = prodTitle.Text.ToLower(),
                PostTitle   = prodTitle.Text
            };

            await _goodsService.AddWithMeta(
                product,
                prodArticul.Text,
                prodCharasteristics.Text,
                prodDescription.Text,
                prodDiscount.Text,
                prodPrice.Text,
                _categories.Where(x => x.IsSelected).Select(x => x.TermId).ToList()
                );

            LoadData();
        }