public async Task <ActionResult> DeleteConfirmed(int id) { Sp_court sp_court = await db.Sp_courts.FindAsync(id); sp_court.Id_parent = 1; sp_court.Dvi_edit = DateTime.Now; sp_court.Is_del = 1; db.Entry(sp_court).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Id_parent,Dvi,Dvi_edit,Is_del,Txt,Tel,Index,Prim")] Sp_court sp_court) { if (ModelState.IsValid) { sp_court.Id_parent = 1; sp_court.Dvi_edit = DateTime.Now; sp_court.Is_del = 0; db.Entry(sp_court).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(sp_court)); }
// GET: Sp_court/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Sp_court sp_court = await db.Sp_courts.FindAsync(id); if (sp_court == null) { return(HttpNotFound()); } return(View(sp_court)); }