Example #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            admpol1 admpol1 = await db.Admpol1.FindAsync(id);

            db.Admpol1.Remove(admpol1);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Example #2
0
        public async Task <ActionResult> Edit([Bind(Include = "gid,code_obl")] admpol1 admpol1)
        {
            if (ModelState.IsValid)
            {
                db.Entry(admpol1).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(admpol1));
        }
Example #3
0
        public async Task <ActionResult> Create([Bind(Include = "gid,code_obl")] admpol1 admpol1)
        {
            if (ModelState.IsValid)
            {
                db.Admpol1.Add(admpol1);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(admpol1));
        }
Example #4
0
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            admpol1 admpol1 = await db.Admpol1.FindAsync(id);

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