Exemplo n.º 1
0
        public ActionResult Add_Bus(BusModel busModel)
        {
            Bus bus = new Bus();

            ViewBag.Bus   = new SelectList(busRepository.GetBus(), "BusId", "BusNo");
            bus.BusId     = busModel.BusId;
            bus.BusNo     = busModel.BusNo;
            bus.TotalSeat = busModel.TotalSeat;
            bus.Rate      = busModel.Rate;
            busRepository.AddBus(bus);
            return(View());
        }
Exemplo n.º 2
0
        public IHttpActionResult Post(Bus b)
        {
            var bus = db.AddBus(b);

            return(Created(Request.RequestUri + "/" + bus.bus_id, bus));
        }
Exemplo n.º 3
0
 public ActionResult CreateUpdate([Bind(Include = "Seats")] BusEntity busEntity)
 {
     busRepository.AddBus(busEntity);
     TempData["Message"] = "Bus Added";
     return(RedirectToAction("Index"));
 }