public async Task <IActionResult> Edit(int id, [Bind("ID,Number,ReceiveDate,FixDate,Name,Phone,Products,Description,Notes,Send,ErgasiaTexnikou,ExtraParts,ChargeExtra,ChargeWork,ChargeMethod,Location,UsedExtra,FPA,Ekkremotites,Promitheftes,Total,ExtraNotes")] Product product) { if (id != product.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(product); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductExists(product.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(product)); }
public async Task <IActionResult> Move([Bind("ID,Number,ReceiveDate,FixDate,Name,Phone,Products,Description,Notes,Send,ErgasiaTexnikou,ExtraParts,ChargeExtra,ChargeWork,ChargeMethod,Location,UsedExtra,FPA,Ekkremotites,Promitheftes,Total,ExtraNotes")] cProsEpiskevi product, int id) { Product it = (from p in _context.Product where p.ID == id select p).SingleOrDefault(); it.FixDate = product.FixDate; it.Location = product.Location; if (ModelState.IsValid) { _context.Update(it); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(product)); }