Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
updated holderservice, started working on update track
  • Loading branch information
Jeremy Mill committed Nov 20, 2015
1 parent a56016d commit c06d810
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
45 changes: 43 additions & 2 deletions TeamDBAwesome/TeamDBAwesome/SqlService/MySqlService.cs
Expand Up @@ -77,6 +77,11 @@ namespace TeamDBAwesome.SqlService
}
}

/// <summary>
/// Adds a new User into the DB
/// </summary>
/// <param name="newCust">a new customer object</param>
/// <returns>a 0 on success, 1 otherwise</returns>
public int AddNewUser(Customer newCust)
{
bool open = this.OpenConnection();
Expand Down Expand Up @@ -133,6 +138,11 @@ namespace TeamDBAwesome.SqlService

}

/// <summary>
/// Update a Customer Object
/// </summary>
/// <param name="customer">A customer object</param>
/// <returns>0 success, 1 otherwise</returns>
public int UpdateCustomer(Customer customer)
{
string update_person = "Update person SET FirstName=\'" + customer.FName + "\', LastName=\'" + customer.LName +
Expand Down Expand Up @@ -167,6 +177,11 @@ namespace TeamDBAwesome.SqlService
}
}

/// <summary>
/// Gets a Customer from the DB
/// </summary>
/// <param name="PersonID">a personID related to the customer</param>
/// <returns>A customer object</returns>
public Customer GetCustomer(int PersonID)
{
bool open = this.OpenConnection();
Expand Down Expand Up @@ -207,8 +222,11 @@ namespace TeamDBAwesome.SqlService

}



/// <summary>
/// Searches the Database
/// </summary>
/// <param name="search">a search object parameterized by tags from the user</param>
/// <returns>a SearchResult object</returns>
public SearchResult Search(Search search)
{
bool open = this.OpenConnection();
Expand Down Expand Up @@ -338,6 +356,11 @@ namespace TeamDBAwesome.SqlService
}
}

/// <summary>
/// Gets a track from the DB
/// </summary>
/// <param name="trackId">The TrackID</param>
/// <returns>a track object</returns>
public Track GetTrack(int trackId)
{
Track track = new Track();
Expand Down Expand Up @@ -376,5 +399,23 @@ namespace TeamDBAwesome.SqlService

return track;
}

public int UpdateTrack(Track track)
{
bool open = this.OpenConnection();

if (open == true)
{
string update_track = "";

MySqlCommand command = new MySqlCommand(update_track, SqlConn);
command.ExecuteNonQuery();

return 0;
}
else
{
return 1;
}
}
}
15 changes: 15 additions & 0 deletions TeamDBAwesome/TeamDBAwesome/js/HolderService.js
Expand Up @@ -20,11 +20,26 @@
CustomerID: null
};

var Blank_Track = {
TrackId: null,
TrackName: null,
AlbumTitle: null,
MediaType: null,
Genre: null,
Composer: null,
Milliseconds: null,
Bytes: null,
UnitPrice: null,
};


//create the accessor for it
return {
getBlankCustomer: function () {
return Blank_Customer;
},
getBlankTrack: function () {
return Blank_Track;
}
};

Expand Down

0 comments on commit c06d810

Please sign in to comment.