Esempio n. 1
0
        public ActionResult Facility(int id)
        {
            infrastructureData inf = db.infrastructureDatas.Where(x => x.Infraid == id).FirstOrDefault();

            TempData["a"] = id;
            return(View(inf));
        }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            infrastructureData infrastructureData = await db.infrastructureDatas.FindAsync(id);

            db.infrastructureDatas.Remove(infrastructureData);
            await db.SaveChangesAsync();

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

                return(RedirectToAction("Index"));
            }
            return(View(infrastructureData));
        }
        public async Task <ActionResult> Create([Bind(Include = "Infraid,Name,Description,Keyword,MetaDescription")] infrastructureData infrastructureData)
        {
            if (ModelState.IsValid)
            {
                db.infrastructureDatas.Add(infrastructureData);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(infrastructureData));
        }
        // GET: Auth/infrastructureDatas/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            infrastructureData infrastructureData = await db.infrastructureDatas.FindAsync(id);

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