mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
save
This commit is contained in:
@@ -38,6 +38,11 @@ export class CalModalPage implements OnInit {
|
||||
ionicForm: FormGroup;
|
||||
isSubmitted = false;
|
||||
|
||||
formSubjectSatus: boolean = false;
|
||||
formDescriptionSatus: boolean = false;
|
||||
formLocationSatus: boolean = false;
|
||||
formEventTypeSatus: boolean = false;
|
||||
|
||||
constructor(public formBuilder: FormBuilder, private modalCtrl: ModalController, private eventService: EventsService, private alertController:AlertService,
|
||||
private navParams: NavParams) {
|
||||
this.postEvent = new Event();
|
||||
@@ -67,7 +72,7 @@ export class CalModalPage implements OnInit {
|
||||
CalendarName: this.selectedSegment,
|
||||
StartDate: selectedStartdDate,
|
||||
EndDate: new Date(selectedEndDate),
|
||||
EventType: '',
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: false,
|
||||
IsRecurring: false,
|
||||
@@ -85,10 +90,10 @@ export class CalModalPage implements OnInit {
|
||||
Body: this.eventBody,
|
||||
Location: '',
|
||||
CalendarId: '',
|
||||
CalendarName: '',
|
||||
CalendarName: 'Oficial',
|
||||
StartDate: selectedStartdDate,
|
||||
EndDate: new Date(selectedEndDate),
|
||||
EventType: '',
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: false,
|
||||
IsRecurring: false,
|
||||
@@ -126,6 +131,35 @@ export class CalModalPage implements OnInit {
|
||||
this.eventService.postEvent(this.postEvent, this.postEvent.CalendarName).subscribe();
|
||||
this.modalCtrl.dismiss(this.postEvent);
|
||||
}
|
||||
else{
|
||||
this.validateFormInputs();
|
||||
}
|
||||
}
|
||||
|
||||
validateFormInputs(){
|
||||
let formSubject = this.postEvent.Subject.trim();
|
||||
let formDescription = this.postEvent.Body.Text.trim();
|
||||
let formLocation = this.postEvent.Location.trim();
|
||||
|
||||
if (!this.postEvent.Subject && formSubject.length <= 0){
|
||||
this.formSubjectSatus=true;
|
||||
}
|
||||
else{
|
||||
this.formSubjectSatus=false;
|
||||
if(!this.postEvent.Body.Text && formDescription.length <= 0){
|
||||
this.formDescriptionSatus=true;
|
||||
}
|
||||
else{
|
||||
this.formDescriptionSatus=false;
|
||||
if (!this.postEvent.Location && formLocation.length <= 0){
|
||||
this.formLocationSatus=true;
|
||||
}
|
||||
else{
|
||||
this.formLocationSatus=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* return (this.postEvent.Subject && formSubject.length > 0); */
|
||||
}
|
||||
|
||||
onViewTitleChanged(title){
|
||||
@@ -142,8 +176,6 @@ export class CalModalPage implements OnInit {
|
||||
/* this.modalCtrl.dismiss(this.postEvent); */
|
||||
}
|
||||
|
||||
|
||||
|
||||
async addAttendees()
|
||||
{
|
||||
const modal = await this.modalCtrl.create({
|
||||
@@ -206,8 +238,6 @@ export class CalModalPage implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
example(){
|
||||
console.log("Mensagem");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user