Esempio n. 1
0
        public ActionResult Create([Bind(Include = "ServiceID,Nume,Adresa,Coordonate")] Service service)
        {
            if (ModelState.IsValid)
            {
                db.Services.Add(service);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(service));
        }
        public ActionResult Create([Bind(Include = "MotorizareID,Nume,ProducatorID")] Motorizare motorizare)
        {
            if (ModelState.IsValid)
            {
                db.Motorizares.Add(motorizare);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(motorizare));
        }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "ProducatorID,Nume")] Producator producator)
        {
            if (ModelState.IsValid)
            {
                db.Producators.Add(producator);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(producator));
        }
Esempio n. 4
0
        public ActionResult Create([Bind(Include = "RezolvareID,ModeRezolvare,MartorID")] ModRezolvare modrezolvare)
        {
            if (ModelState.IsValid)
            {
                db.ModRezolvares.Add(modrezolvare);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.MartorID = new SelectList(db.MartoriBords, "MartorID", "Nume", modrezolvare.MartorID);
            return(View(modrezolvare));
        }
        public ActionResult Create([Bind(Include = "VehiculID,ModelID,MotorizareID,An")] Vehicul vehicul)
        {
            if (ModelState.IsValid)
            {
                db.Vehiculs.Add(vehicul);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.An           = new SelectList(db.Ans, "AnID", "AnID", vehicul.An);
            ViewBag.ModelID      = new SelectList(db.Models, "ModelID", "Nume", vehicul.ModelID);
            ViewBag.MotorizareID = new SelectList(db.Motorizares, "MotorizareID", "Nume", vehicul.MotorizareID);
            return(View(vehicul));
        }