1 | import { Component, OnInit, Inject, Output, EventEmitter } from '@angular/core';
|
---|
2 | import { Pharmacy } from '../models/Pharmacy';
|
---|
3 | import { HttpClient } from '@angular/common/http';
|
---|
4 | import { MatDialog } from '@angular/material/dialog';
|
---|
5 | import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar';
|
---|
6 | import { Router, RouterModule } from '@angular/router';
|
---|
7 | import { PharmacyHead } from '../models/PharmacyHead';
|
---|
8 | import { FormControl } from '@angular/forms';
|
---|
9 |
|
---|
10 |
|
---|
11 | @Component({
|
---|
12 | selector: 'app-admin',
|
---|
13 | templateUrl: './admin.component.html',
|
---|
14 | styleUrls: ['./admin.component.css']
|
---|
15 | })
|
---|
16 | export class AdminComponent implements OnInit {
|
---|
17 | public heads: PharmacyHead[];
|
---|
18 | public head: PharmacyHead;
|
---|
19 | public status: string;
|
---|
20 |
|
---|
21 | constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string, private dialog: MatDialog, private _snackBar: MatSnackBar, private router: Router) {
|
---|
22 | http.get<PharmacyHead[]>(baseUrl + 'PharmacyHead/Get?').subscribe(result => {
|
---|
23 | this.heads = result;
|
---|
24 | console.log(this.heads);
|
---|
25 | }, error => console.error(error));
|
---|
26 | }
|
---|
27 |
|
---|
28 | ngOnInit(): void {
|
---|
29 | this.head = new PharmacyHead();
|
---|
30 | }
|
---|
31 |
|
---|
32 | createHead() {
|
---|
33 | console.log(this.head);
|
---|
34 | // post request vo prodolzenie
|
---|
35 |
|
---|
36 | this.status="Status bar createHead";
|
---|
37 | //window.location.reload();
|
---|
38 | }
|
---|
39 |
|
---|
40 | Del(head: PharmacyHead) {
|
---|
41 | console.log(this.head);
|
---|
42 | // post request vo prodolzenie
|
---|
43 |
|
---|
44 | this.status="Status bar Del";
|
---|
45 | }
|
---|
46 |
|
---|
47 | ChangeDialog(head: PharmacyHead) {
|
---|
48 | console.log(this.head);
|
---|
49 |
|
---|
50 | }
|
---|
51 |
|
---|
52 | Reject() {
|
---|
53 | console.log('Rejected');
|
---|
54 | // post request vo prodolzenie
|
---|
55 |
|
---|
56 | }
|
---|
57 |
|
---|
58 | Approve() {
|
---|
59 | console.log('Approved');
|
---|
60 | // post request vo prodolzenie
|
---|
61 |
|
---|
62 | }
|
---|
63 |
|
---|
64 | }
|
---|