private async void CvProducts_SelectionChanged(object sender, SelectionChangedEventArgs e) { PopularProduct SelectedItem = e.CurrentSelection.FirstOrDefault() as PopularProduct; if (SelectedItem != null) { await Navigation.PushModalAsync(new ProductDetailPage(SelectedItem.id)); ((CollectionView)sender).SelectedItem = null; } }
public async Task <IActionResult> PopularProductCreate(PopularProductModel productModel, IFormFile formFile) { var entity = new PopularProduct() { Title = productModel.Title, Url = productModel.Url }; if (formFile != null) { var extention = Path.GetExtension(formFile.FileName); var randomName = string.Format($"{Guid.NewGuid()}{extention}"); entity.Image = randomName; var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot\\img", randomName); using (var stream = new FileStream(path, FileMode.Create)) { await formFile.CopyToAsync(stream); } } _popularProductServices.Create(entity); return(RedirectToAction("PopularProductList")); }
public void Update(PopularProduct Entity) { _popularProductRepository.Update(Entity); }
public void Delete(PopularProduct Entity) { _popularProductRepository.Delete(Entity); }
public void Create(PopularProduct Entity) { _popularProductRepository.Create(Entity); }