public ActionResult DeleteConfirmed(int id) { TRAILER tRAILER = db.TRAILER.Find(id); //db.TRAILER.Remove(tRAILER); tRAILER.Estado = false; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "IdTrailer,PlacaTrailer,Estado,IdTipoTrailer")] TRAILER tRAILER) { if (ModelState.IsValid) { bool existeUsuario = db.TRAILER.Any(x => x.PlacaTrailer.ToUpper() == tRAILER.PlacaTrailer.ToUpper()); db.Entry(tRAILER).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdTipoTrailer = new SelectList(db.TIPOTRAILER, "Id", "TipoTrailer1", tRAILER.IdTipoTrailer); return(View(tRAILER)); }
// GET: TRAILER/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TRAILER tRAILER = db.TRAILER.Find(id); if (tRAILER == null) { return(HttpNotFound()); } return(View(tRAILER)); }
// GET: TRAILER/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TRAILER tRAILER = db.TRAILER.Find(id); if (tRAILER == null) { return(HttpNotFound()); } ViewBag.IdTipoTrailer = new SelectList(db.TIPOTRAILER, "Id", "TipoTrailer1", tRAILER.IdTipoTrailer); return(View(tRAILER)); }
public List <byte[]> binLinhas() { List <byte[]> binArquivoSaida = new List <byte[]>(); binArquivoSaida.Add(HEADER.GeraBinario()); foreach (LoteCEL604 lote in LOTES) { foreach (Cheque c in lote.CHEQUES) { binArquivoSaida.AddRange(c.GeraBinarios()); } binArquivoSaida.Add(lote.FECHAMENTO.GeraBinario()); } binArquivoSaida.Add(TRAILER.GeraBinario()); return(binArquivoSaida); }
public ActionResult Create([Bind(Include = "IdTrailer,PlacaTrailer,Estado,IdTipoTrailer")] TRAILER tRAILER) { if (ModelState.IsValid) { bool existeUsuario = db.TRAILER.Any(x => x.PlacaTrailer.ToUpper() == tRAILER.PlacaTrailer.ToUpper()); if (!existeUsuario) { tRAILER.PlacaTrailer = tRAILER.PlacaTrailer.ToUpper(); tRAILER.Estado = true; db.TRAILER.Add(tRAILER); db.SaveChanges(); return(RedirectToAction("Index")); } else { ViewBag.Message = "Ya existe un registro con este numero de trailer, " + tRAILER.PlacaTrailer + " por favor revise..."; } } ViewBag.IdTipoTrailer = new SelectList(db.TIPOTRAILER, "Id", "TipoTrailer1", tRAILER.IdTipoTrailer); return(View(tRAILER)); }