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(); }
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(); }
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(); }
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(); }