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

            db.TIPO_SEDE.Remove(tIPO_SEDE);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Edit([Bind(Include = "id_tipo,nombre")] TIPO_SEDE tIPO_SEDE)
        {
            if (ModelState.IsValid)
            {
                db.Entry(tIPO_SEDE).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(tIPO_SEDE));
        }
Exemplo n.º 3
0
        public async Task <ActionResult> Create([Bind(Include = "id_tipo,nombre")] TIPO_SEDE tIPO_SEDE)
        {
            if (ModelState.IsValid)
            {
                db.TIPO_SEDE.Add(tIPO_SEDE);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(tIPO_SEDE));
        }
Exemplo n.º 4
0
        // GET: TIPO_SEDE/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (Session["User"] != null)
            {
                if (id == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }
                TIPO_SEDE tIPO_SEDE = await db.TIPO_SEDE.FindAsync(id);

                if (tIPO_SEDE == null)
                {
                    return(HttpNotFound());
                }
                return(View(tIPO_SEDE));
            }
            return(RedirectToAction("index", "Home"));
        }