Add restaurants

This commit is contained in:
2016-12-23 20:38:59 -05:00
parent 545c74f214
commit 4c7b9310c0
13 changed files with 435 additions and 0 deletions

View File

@ -101,6 +101,33 @@ Attendee.prototype.isAttendee = function() {
this.Name != empty_attendee.Name;
}
function Restaurant() {
this.RestaurantId = -1;
this.Name = "";
}
Restaurant.prototype.toJSON = function() {
var json_obj = {};
json_obj.RestaurantId = this.RestaurantId;
json_obj.Name = this.Name;
return JSON.stringify(json_obj);
}
Restaurant.prototype.fromJSON = function(json_input) {
var json_obj = getJSONObj(json_input);
if (json_obj.hasOwnProperty("RestaurantId"))
this.RestaurantId = json_obj.RestaurantId;
if (json_obj.hasOwnProperty("Name"))
this.Name = json_obj.Name;
}
Restaurant.prototype.isRestaurant = function() {
var empty_attendee = new Restaurant();
return this.RestaurantId != empty_attendee.RestaurantId ||
this.Name != empty_attendee.Name;
}
function Error() {
this.ErrorId = -1;
this.ErrorString = "";