public async Task <IActionResult> PutEmployee(Guid id, Employee employee) { if (id != employee.Id) { return(BadRequest()); } _context.Entry(employee).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit(Kasir kasir) { if (ModelState.IsValid) { db.Entry(kasir).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(kasir)); }
public ActionResult Edit(Barang barang) { if (ModelState.IsValid) { db.Entry(barang).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IDKasir = new SelectList(db.Kasir, "IDKasir", "NamaKasir", barang.IDKasir); return(View(barang)); }