//ADD //Add ride /// <summary> /// Adds a Ride to the Rides table in the database /// </summary> /// <param name="ride"></param> public void AddRide(Ride ride) { RidesRow row = dataset.Rides.NewRidesRow(); row.Name = ride.Name; row.Catagory = ride.Category; row.Status = ride.Status; ride.Id = AddRideRow(row); }
//Edit Ride status in database /// <summary> /// Edits the Ride status inside the database /// </summary> /// <param name="ride"></param> /// <param name="status"></param> public void EditRideStatus(Ride ride, string status) { //Get database rows RidesDataTable rideRows = new RidesDataTable(); AdapterManager.RidesTableAdapter.Fill(rideRows); //Find the rows to edit RidesRow row = rideRows.FindById(ride.Id); //Update the row with edited data row.Status = status; //Save changes AdapterManager.RidesTableAdapter.Update(rideRows); }
private int AddRideRow(RidesRow row) { dataset.Rides.Rows.Add(row); AdapterManager.RidesTableAdapter.Update(dataset.Rides); return(dataset.Rides.First().Id); }