Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TRAILER tRAILER = db.TRAILER.Find(id);

            //db.TRAILER.Remove(tRAILER);
            tRAILER.Estado = false;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        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));
        }
Пример #3
0
        // 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));
        }
Пример #4
0
        // 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));
        }
Пример #5
0
        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);
        }
Пример #6
0
 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));
 }