Esempio n. 1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            tmake tmake = await db.tmakes.FindAsync(id);

            db.tmakes.Remove(tmake);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public async Task <ActionResult> Edit([Bind(Include = "id,make_na")] tmake tmake)
        {
            if (ModelState.IsValid)
            {
                db.Entry(tmake).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(tmake));
        }
Esempio n. 3
0
        public async Task <ActionResult> Create([Bind(Include = "id,make_na")] tmake tmake)
        {
            if (ModelState.IsValid)
            {
                db.tmakes.Add(tmake);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(tmake));
        }
Esempio n. 4
0
        // GET: tmakes/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tmake tmake = await db.tmakes.FindAsync(id);

            if (tmake == null)
            {
                return(HttpNotFound());
            }
            return(View(tmake));
        }