public ActionResult DeleteConfirmed(int id) { CabecalhoNFE cabecalhoNFE = db.CabecalhoNFE.Find(id); db.CabecalhoNFE.Remove(cabecalhoNFE); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,NumNF,Id_for,TipoNFE,DataEmissao,DataEntrada,HoraEntrada")] CabecalhoNFE cabecalhoNFE) { if (ModelState.IsValid) { db.Entry(cabecalhoNFE).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Id_for = new SelectList(db.Fornecedores, "Id", "RazaoSocial", cabecalhoNFE.Id_for); return(View(cabecalhoNFE)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CabecalhoNFE cabecalhoNFE = db.CabecalhoNFE.Find(id); if (cabecalhoNFE == null) { return(HttpNotFound()); } return(View(cabecalhoNFE)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CabecalhoNFE cabecalhoNFE = db.CabecalhoNFE.Find(id); if (cabecalhoNFE == null) { return(HttpNotFound()); } ViewBag.Id_for = new SelectList(db.Fornecedores, "Id", "RazaoSocial", cabecalhoNFE.Id_for); return(View(cabecalhoNFE)); }