Ejemplo n.º 1
0
        public ActionResult Create([Bind(Include = "PId,Name,ConatctNo")] tblPassenger tblPassenger)
        {
            if (ModelState.IsValid)
            {
                db.tblPassengers.Add(tblPassenger);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tblPassenger));
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "DId,Name,Salary,Residence,ContactNo")] tblDriver tblDriver)
        {
            if (ModelState.IsValid)
            {
                db.tblDrivers.Add(tblDriver);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tblDriver));
        }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "RId,Driver,Passenger,RequestLocation,Destination,vehicle,Rent,shift")] tblRide tblRide)
        {
            if (ModelState.IsValid)
            {
                db.tblRides.Add(tblRide);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Driver    = new SelectList(db.tblDrivers, "DId", "Name", tblRide.Driver);
            ViewBag.Passenger = new SelectList(db.tblPassengers, "PId", "Name", tblRide.Passenger);
            return(View(tblRide));
        }