Poent Ts
Poent Ts
Poent Ts
@Component({
selector: 'app-user',
templateUrl: './user.component.html',
styleUrls: ['./user.component.css']
})
export class UserComponent implements OnInit {
ngOnInit(): void {
this.user.getAllExams();
}
OpenCreateDialog() {
this.dialog.open(this.CallCreateDialog);
}
CreateData() {
this.user.CreateExam(this.CreateForm.value)
}
SaveData() {
this.user.UpdateExam(this.UpdateForm.value);
}
OpenDeleteDialog(id: number) {
// debugger
const dialogRef = this.dialog.open(this.CallDeleteDialog);
dialogRef.afterClosed().subscribe((result) => {
console.log(result)
if (result != undefined) {
if (result == 'yes') {
this.user.DeleteExam(id);
}
}
})
}
SearchButton() {
if (this.examName == ''){
this.user.getAllExams();
}else{
this.user.SearchByExamName(this.examName)
console.log(this.user.exams);
}
}
}