public async Task <IActionResult> Edit(int id, [Bind("ProductId,ProductName,Color,Size,Price,AmountInStock,AmountOfOrders,DeliveryPrice,ImgId")] Productes productes) { if (id != productes.ProductId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(productes); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductesExists(productes.ProductId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(productes)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ProductName,Price,AmountInStock,AmountOfOrders,DeliveryPrice,ImgId,SubCategoryId")] Productes productes) { if (id != productes.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(productes); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductesExists(productes.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("List")); } ViewData["SubIdE"] = new SelectList(await _context.SubCategory.ToListAsync(), "Id", "Name", productes.SubCategory.SubName); return(View(productes)); }
public async Task <IActionResult> Create([Bind("ProductId,ProductName,Color,Size,Price,AmountInStock,AmountOfOrders,DeliveryPrice,ImgId")] Productes productes) { if (ModelState.IsValid) { _context.Add(productes); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(productes)); }
public async Task <IActionResult> Create([Bind("Id,ProductName,Price,AmountInStock,AmountOfOrders,DeliveryPrice,ImgId,SubCategoryId")] Productes productes) { if (ModelState.IsValid) { _context.Add(productes); await _context.SaveChangesAsync(); return(RedirectToAction("List")); } ViewData["SubId"] = new SelectList(await _context.SubCategory.ToListAsync(), "Id", "SubName", productes.SubCategory.SubName); return(View(productes)); }
private void productsToolStripMenuItem_Click(object sender, EventArgs e) { Productes productes = new Productes(); productes.Show(); }
public IActionResult TestFunction(Productes productes) { return(View()); }