Ejemplo n.º 1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            infrastructure infrastructure = await db.infrastructures.FindAsync(id);

            db.infrastructures.Remove(infrastructure);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Edit([Bind(Include = "id,Name,Description,Keyword,MetaDescription")] infrastructure infrastructure)
        {
            if (ModelState.IsValid)
            {
                db.Entry(infrastructure).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(infrastructure));
        }
Ejemplo n.º 3
0
        public async Task <ActionResult> Create([Bind(Include = "id,Name,Description,Keyword,MetaDescription")] infrastructure infrastructure)
        {
            if (ModelState.IsValid)
            {
                db.infrastructures.Add(infrastructure);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

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

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