public void Rabot_delect(int id) { Rabot Rabot = context.Rabot.Find(id); context.Rabot.Remove(Rabot); context.SaveChanges(); }
public ActionResult rabot_delete(int id) { Rabot a = new Rabot { Id = id }; db.Entry(a).State = EntityState.Deleted; db.SaveChanges(); return(RedirectToAction("Rabot")); }
public ActionResult rabot_edit(int?id) { if (id == null) { return(HttpNotFound()); } Rabot app = db.Rabot.Find(id); if (app != null) { SelectList Oboryd = new SelectList(db.Oboryd, "Id", "Model_oboryd"); ViewBag.Oboryd = Oboryd; SelectList Vid_rabot = new SelectList(db.Vid_rabot, "Id", "Name_vid_rabot"); ViewBag.Vid_rabot = Vid_rabot; return(View(app)); } return(HttpNotFound()); }
public ActionResult rabot_edit(Rabot a) { db.Entry(a).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Rabot")); }
public ActionResult rabot_add(Rabot a) { db.Rabot.Add(a); db.SaveChanges(); return(RedirectToAction("Rabot")); }
public void Rabot_add([FromBody] Rabot t) { context.Rabot.Add(t); context.SaveChanges(); }