public ActionResult UpdateBus(string busId, int capacity, string license, string state, string status)
 {
     DatabaseInterface db = new DatabaseInterface();
     if (!db.IsLicenseUnique(license, busId))
         return Json("false");
     Bus bus = db.GetBusByBusId(int.Parse(busId));
     bus.LicensePlate = license;
     bus.BusId = int.Parse(busId);
     BusStatus busStatus;
     if (status.Equals("0"))
     {
         busStatus = BusStatus.Active;
     }
     else
     {
         busStatus = BusStatus.Inactive;
     }
     bus.Status = busStatus;
     bus.Capacity = capacity;
     bus.State = state;
     db.UpdateBus(bus);
     return Json("true");
 }
        public ActionResult AddNewBus(int capacity, string license, string state)
        {
            DatabaseInterface db = new DatabaseInterface();
            if (!db.IsLicenseUnique(license))
                return Json("false");

            Bus bus = new Bus()
            {
                Id = ObjectId.GenerateNewId(),
                LicensePlate = license,
                BusId = db.GetNextBusId(),
                Status = BusStatus.Active,
                Capacity = capacity,
                State = state,
                AssignedTo = -1

            };
            db.AddBus(bus);
            return Json(new{
               success = "true",
               id = bus.Id.ToString()
            });
        }