예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tipo_persona tipo_persona = db.tipo_persona.Find(id);

            db.tipo_persona.Remove(tipo_persona);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            tipo_persona tipo_persona = await db.tipo_persona.FindAsync(id);

            db.tipo_persona.Remove(tipo_persona);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #3
0
 public ActionResult Edit([Bind(Include = "id,nombre")] tipo_persona tipo_persona)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tipo_persona).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tipo_persona));
 }
예제 #4
0
        public ActionResult Create([Bind(Include = "id,nombre")] tipo_persona tipo_persona)
        {
            if (ModelState.IsValid)
            {
                db.tipo_persona.Add(tipo_persona);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tipo_persona));
        }
예제 #5
0
        public async Task <ActionResult> Edit([Bind(Include = "id,tipo_persona1")] tipo_persona tipo_persona)
        {
            if (ModelState.IsValid)
            {
                db.Entry(tipo_persona).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(tipo_persona));
        }
예제 #6
0
        public async Task <ActionResult> Create([Bind(Include = "id,tipo_persona1")] tipo_persona tipo_persona)
        {
            if (ModelState.IsValid)
            {
                db.tipo_persona.Add(tipo_persona);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(tipo_persona));
        }
예제 #7
0
        // GET: Tipopersona/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tipo_persona tipo_persona = db.tipo_persona.Find(id);

            if (tipo_persona == null)
            {
                return(HttpNotFound());
            }
            return(View(tipo_persona));
        }
예제 #8
0
        // GET: tipo_persona/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tipo_persona tipo_persona = await db.tipo_persona.FindAsync(id);

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