Add restaurants
This commit is contained in:
27
js/models.js
27
js/models.js
@ -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 = "";
|
||||
|
Reference in New Issue
Block a user