public async Task <ActionResult> DeleteConfirmed(int id) { Osv osv = await db.Osvs.FindAsync(id); db.Osvs.Remove(osv); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "ID,DateOsv,DatePrib,Control,Locat,Dost,Trud,Posic,Bron")] Osv osv) { if (ModelState.IsValid) { db.Entry(osv).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(osv)); }
public async Task <ActionResult> Create([Bind(Include = "ID,DateOsv,DatePrib,Control,Locat,Dost,Trud,Posic,Bron")] Osv osv) { if (ModelState.IsValid) { db.Osvs.Add(osv); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(osv)); }
public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Osv osv = await db.Osvs.FindAsync(id); if (osv == null) { return(HttpNotFound()); } return(View(osv)); }
public async Task <ActionResult> CreateOsv([Bind(Include = "ID,DateOsv,DatePrib,Control,Locat,Dost,Trud,Posic,Bron")] Osv CreateOsv) { if (ModelState.IsValid) { db.Licos.Find(Session["IDLico"]).Osvs.Add(CreateOsv); //db.Addresses.Add(CreateAddress); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(CreateOsv)); }