示例#1
0
 public void Close()
 {
     GetProduct.Product.Category = Categoryjoin.Split(",").ToList();
     GetProduct.Product.Services = Servicejoin.Split(",").ToList();
     GetProduct.Product.Tags     = Tagjoin.Split(",").ToList();
     Show         = "";
     Style        = "none;";
     ShowBackdrop = false;
     StateHasChanged();
 }
示例#2
0
        public void Delete(UpdateProductViewModel model)
        {
            GetProduct.Product.Category = Categoryjoin.Split(",").ToList();
            GetProduct.Product.Services = Servicejoin.Split(",").ToList();
            GetProduct.Product.Tags     = Tagjoin.Split(",").ToList();

            Result = api.Delete(new DeleteProductViewModel
            {
                ProductRequest = model.ProductBefore
            });

            if (Result == "Deleted")
            {
                Models.Products.Remove(model);
            }

            StateHasChanged();
        }
示例#3
0
        public void Edit(UpdateProductViewModel model)
        {
            GetProduct.Product.Category = Categoryjoin.Split(",").ToList();
            GetProduct.Product.Services = Servicejoin.Split(",").ToList();
            GetProduct.Product.Tags     = Tagjoin.Split(",").ToList();

            Result = api.Edit(model);

            if (Result == "Modified")
            {
                model.ProductBefore = new FindProductViewModel
                {
                    Customer = model.Product.Customer,
                    SiteName = model.Product.SiteName,
                    SiteUrl  = model.Product.SiteUrl
                };
            }

            StateHasChanged();
        }
示例#4
0
        public void Create()
        {
            GetProduct.Product.Category = Categoryjoin.Split(",").ToList();
            GetProduct.Product.Services = Servicejoin.Split(",").ToList();
            GetProduct.Product.Tags     = Tagjoin.Split(",").ToList();

            var model = new UpdateProductViewModel
            {
                Product = new GetProductViewModel
                {
                    Category    = GetProduct.Product.Category,
                    Customer    = GetProduct.Product.Customer,
                    Description = GetProduct.Product.Description,
                    EndDate     = GetProduct.Product.EndDate,
                    Images      = GetProduct.Product.Images,
                    Services    = GetProduct.Product.Services,
                    SiteName    = GetProduct.Product.SiteName,
                    SiteUrl     = GetProduct.Product.SiteUrl,
                    StartDate   = GetProduct.Product.StartDate,
                    Tags        = GetProduct.Product.Tags
                },
                ProductBefore = new FindProductViewModel()
            };

            Result = api.Create(model.Product);

            if (Result == "Added")
            {
                model.ProductBefore = new FindProductViewModel
                {
                    Customer = GetProduct.Product.Customer,
                    SiteName = GetProduct.Product.SiteName,
                    SiteUrl  = GetProduct.Product.SiteUrl
                };

                Models.Products.Add(model);
            }

            StateHasChanged();
        }