Add attendees

This commit is contained in:
2016-12-23 08:30:29 -05:00
parent 3ba0b8dc26
commit 545c74f214
7 changed files with 175 additions and 8 deletions

View File

@ -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 = "";