public ActionResult DeleteConfirmed(int id)
        {
            tbl_Encomenda tbl_Encomenda = db.tbl_Encomenda.Find(id);

            db.tbl_Encomenda.Remove(tbl_Encomenda);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id_Encomenda,Quantidade,Data,UserName")] tbl_Encomenda tbl_Encomenda)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_Encomenda).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserName = new SelectList(db.AspNetUsers, "Id", "Email", tbl_Encomenda.UserName);
     return(View(tbl_Encomenda));
 }
        // GET: tbl_Encomenda/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_Encomenda tbl_Encomenda = db.tbl_Encomenda.Find(id);

            if (tbl_Encomenda == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_Encomenda));
        }
        // GET: tbl_Encomenda/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_Encomenda tbl_Encomenda = db.tbl_Encomenda.Find(id);

            if (tbl_Encomenda == null)
            {
                return(HttpNotFound());
            }
            ViewBag.UserName = new SelectList(db.AspNetUsers, "Id", "Email", tbl_Encomenda.UserName);
            return(View(tbl_Encomenda));
        }