54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { ServiceComm } from '../../services/serviceComm';
|
|
import { ServiceApiGet } from '../../services/serviceApiGet';
|
|
import { ServiceApiPost } from '../../services/serviceApiPost';
|
|
|
|
|
|
@Component({
|
|
selector: 'app-new-jump',
|
|
templateUrl: './new-jump.component.html',
|
|
styleUrls: ['./new-jump.component.css']
|
|
})
|
|
export class NewJumpComponent implements OnInit {
|
|
beginDate: Date;
|
|
endDate: Date;
|
|
defaultExitAltitude: number;
|
|
defaultDeployAltitude: number;
|
|
countOfJumps: number;
|
|
selectedDz: number;
|
|
selectedRig: number;
|
|
selectedAircraft: number;
|
|
selectedJumpType: number;
|
|
withCutaway: boolean;
|
|
|
|
constructor(private serviceComm: ServiceComm,
|
|
private serviceApiGet: ServiceApiGet,
|
|
private serviceApiPost: ServiceApiPost) {
|
|
this.beginDate = new Date();
|
|
this.endDate = new Date();
|
|
|
|
this.defaultExitAltitude = 4000;
|
|
this.defaultDeployAltitude = 1000;
|
|
this.countOfJumps = 0;
|
|
}
|
|
|
|
ngOnInit() {
|
|
this.serviceComm.updatedComponentTitle('Add a new jump');
|
|
}
|
|
|
|
onFormSubmit() {
|
|
this.serviceApiPost.AddJump(
|
|
this.selectedJumpType,
|
|
this.selectedAircraft,
|
|
this.selectedDz,
|
|
this.selectedRig,
|
|
this.withCutaway,
|
|
this.beginDate,
|
|
this.endDate,
|
|
this.defaultExitAltitude,
|
|
this.defaultDeployAltitude,
|
|
this.countOfJumps
|
|
);
|
|
}
|
|
}
|