public ActionResult DeleteConfirmed(int id) { msKategoriBarang msKategoriBarang = db.msKategoriBarangs.Find(id); msKategoriBarang.status = 0; msKategoriBarang.modified_date = DateTime.Now; msKategoriBarang.modified_by = "Fikri Adriansyah"; db.Entry(msKategoriBarang).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id_kategori,nama,status,created_date,created_by,modified_date,modified_by")] msKategoriBarang msKategoriBarang) { if (ModelState.IsValid) { msKategoriBarang.status = 1; msKategoriBarang.modified_date = DateTime.Now; msKategoriBarang.modified_by = "Fikri Adriansyah"; db.Entry(msKategoriBarang).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(msKategoriBarang)); }
// GET: msKategoriBarangs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } msKategoriBarang msKategoriBarang = db.msKategoriBarangs.Find(id); if (msKategoriBarang == null) { return(HttpNotFound()); } return(View(msKategoriBarang)); }