public async Task <ActionResult> Move(int?id) { Product it = (from p in _context.Product where p.ID == id select p).SingleOrDefault(); it.Location = "Ολοκληρωμένα"; if (ModelState.IsValid) { await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(RedirectToAction(nameof(Index))); }
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)); }