public async Task <IActionResult> UploadPic(PicVM <int> model) { string file = await _common.UploadPic(model.Img); if (!string.IsNullOrEmpty(file)) { if (ModelState.IsValid) { if (await _offertService.UploadImg(new ImageOffert { ImageName = file, OffertId = model.Id, })) { TempData["Offert"] = "Imagen cargada correctamente"; } } } return(RedirectToAction("Offerts", "Admin")); }
public async Task <IActionResult> UploadPic(PicVM <Guid> model) { var file = await _common.UploadPic(model.Img); if (!string.IsNullOrEmpty(file)) { if (ModelState.IsValid) { if (await _service.UplodadPic(new ProductPic { ProductId = model.Id, CreatedAt = DateTime.Now, PicName = file })) { TempData["Product"] = "Imagen cargada correctamente"; } } } return(RedirectToAction("Products", "Admin")); }
public PicCommand(PicVM viewModel) { this.viewModel = viewModel; }
public ListPicPage() { InitializeComponent(); viewModel = new PicVM(); BindingContext = viewModel; }