Exemplo n.º 1
0
        public async Task <IActionResult> Edit(tablephonebook user)
        {
            db.tablephonebook.Update(user);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public ActionResult Details(int id)
        {
            List <tablephonebook> tfb = db.tablephonebook.ToList();
            tablephonebook        c   = tfb.FirstOrDefault(user => user.id == id);

            if (c != null)
            {
                return(PartialView(c));
            }
            return(NotFound());
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(int?id)
        {
            if (id != null)
            {
                tablephonebook user = await db.tablephonebook.FirstOrDefaultAsync(p => p.id == id);

                if (user != null)
                {
                    return(View(user));
                }
            }
            return(NotFound());
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Delete(int?id)
        {
            if (id != null)
            {
                tablephonebook user = await db.tablephonebook.FirstOrDefaultAsync(p => p.id == id);

                if (user != null)
                {
                    db.tablephonebook.Remove(user);
                    await db.SaveChangesAsync();

                    return(RedirectToAction("Index"));
                }
            }
            return(View("Index"));
        }