Exemplo n.º 1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Osv osv = await db.Osvs.FindAsync(id);

            db.Osvs.Remove(osv);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        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));
        }