mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
Attendees Modal done
This commit is contained in:
@@ -12,9 +12,8 @@ import { AttendeeModalPage } from '../attendee-modal/attendee-modal.page';
|
||||
export class AttendeesPage implements OnInit {
|
||||
|
||||
eventAttendees: EventPerson[];
|
||||
segment:string = "required";
|
||||
segment:string = "true";
|
||||
shouldShowCancel:boolean = true;
|
||||
showAttendees: EventPerson[];
|
||||
|
||||
searchCountryString = ''; // initialize your searchCountryString string empty
|
||||
|
||||
@@ -24,18 +23,6 @@ export class AttendeesPage implements OnInit {
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.loadAttendees();
|
||||
}
|
||||
|
||||
onSegmentChange(){
|
||||
this.loadAttendees();
|
||||
}
|
||||
|
||||
loadAttendees(){
|
||||
let isrequired: boolean = (this.segment == "required");
|
||||
this.showAttendees = this.eventAttendees.filter(function(person) {
|
||||
return person.IsRequired == isrequired;
|
||||
});
|
||||
}
|
||||
|
||||
save(){
|
||||
@@ -45,6 +32,15 @@ export class AttendeesPage implements OnInit {
|
||||
close(){
|
||||
this.modalCtrl.dismiss(null);
|
||||
}
|
||||
|
||||
removeAttendee(attendee: EventPerson)
|
||||
{
|
||||
let index: number = this.eventAttendees.findIndex((att) => {
|
||||
return att.EmailAddress == attendee.EmailAddress
|
||||
});
|
||||
|
||||
this.eventAttendees.splice(index, 1);
|
||||
}
|
||||
|
||||
async addAttendees()
|
||||
{
|
||||
@@ -68,10 +64,13 @@ export class AttendeesPage implements OnInit {
|
||||
let att = {
|
||||
"EmailAddress": newattendee.EmailAddress,
|
||||
"Name": newattendee.Name,
|
||||
"IsRequired": (this.segment == "required")
|
||||
"IsRequired": (this.segment == "true")
|
||||
};
|
||||
if (this.eventAttendees == null)
|
||||
{
|
||||
this.eventAttendees = new Array();
|
||||
}
|
||||
this.eventAttendees.push(att);
|
||||
this.showAttendees.push(att);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user