コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            InformacoesRoubos informacoesRoubos = db.InformacoesRoubos.Find(id);

            informacoesRoubos.Ativo = (OpcaoStatusInformacoesRoubos)1;
            db.SaveChanges();
            return(RedirectToAction("ListaUsuario", "InformacoesRoubos"));
        }
コード例 #2
0
 public ActionResult Create([Bind(Include = "Id,Cidade,Estado,Relato,LocalAdicional,DataRoubo,BicicletasId,Ativo")] InformacoesRoubos informacoesRoubos)
 {
     if (ModelState.IsValid)
     {
         db.InformacoesRoubos.Add(informacoesRoubos);
         db.SaveChanges();
         return(RedirectToAction("ListaUsuario", "InformacoesRoubos"));
     }
     ViewBag.BicicletasId = new SelectList(db.Bicicletas, "Id", "Modelo", informacoesRoubos.BicicletasId);
     return(View(informacoesRoubos));
 }
コード例 #3
0
        // GET: InformacoesRoubos/Details
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InformacoesRoubos informacoesRoubos = db.InformacoesRoubos.Find(id);

            if (informacoesRoubos == null)
            {
                return(HttpNotFound());
            }
            return(View(informacoesRoubos));
        }
コード例 #4
0
        // GET: InformacoesRoubos/Edit
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InformacoesRoubos informacoesRoubos = db.InformacoesRoubos.Find(id);

            if (informacoesRoubos == null)
            {
                return(HttpNotFound());
            }
            ViewBag.BicicletasId = new SelectList(db.Bicicletas.Where(w => w.Ativo == 0), "Id", "Modelo", informacoesRoubos.BicicletasId);
            return(View(informacoesRoubos));
        }