Add attendees
This commit is contained in:
29
js/models.js
29
js/models.js
@ -1,5 +1,3 @@
|
||||
var Big = require('big.js');
|
||||
|
||||
function getJSONObj(json_input) {
|
||||
if (typeof json_input == "string")
|
||||
return $.parseJSON(json_input)
|
||||
@ -76,6 +74,33 @@ Session.prototype.isSession = function() {
|
||||
this.UserId != empty_session.UserId;
|
||||
}
|
||||
|
||||
function Attendee() {
|
||||
this.AttendeeId = -1;
|
||||
this.Name = "";
|
||||
}
|
||||
|
||||
Attendee.prototype.toJSON = function() {
|
||||
var json_obj = {};
|
||||
json_obj.AttendeeId = this.AttendeeId;
|
||||
json_obj.Name = this.Name;
|
||||
return JSON.stringify(json_obj);
|
||||
}
|
||||
|
||||
Attendee.prototype.fromJSON = function(json_input) {
|
||||
var json_obj = getJSONObj(json_input);
|
||||
|
||||
if (json_obj.hasOwnProperty("AttendeeId"))
|
||||
this.AttendeeId = json_obj.AttendeeId;
|
||||
if (json_obj.hasOwnProperty("Name"))
|
||||
this.Name = json_obj.Name;
|
||||
}
|
||||
|
||||
Attendee.prototype.isAttendee = function() {
|
||||
var empty_attendee = new Attendee();
|
||||
return this.AttendeeId != empty_attendee.AttendeeId ||
|
||||
this.Name != empty_attendee.Name;
|
||||
}
|
||||
|
||||
function Error() {
|
||||
this.ErrorId = -1;
|
||||
this.ErrorString = "";
|
||||
|
Reference in New Issue
Block a user