Changeset de18858 for Farmatiko/ClientApp/src/app
- Timestamp:
- 07/29/20 19:46:21 (4 years ago)
- Branches:
- master
- Children:
- 4e72684
- Parents:
- e42f61a
- Location:
- Farmatiko/ClientApp/src/app
- Files:
-
- 2 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/admin/admin.component.html
re42f61a rde18858 31 31 </thead> 32 32 <tbody> 33 <tr *ngFor=" ">34 <td> data1</td>35 <td> data2</td>36 <td> data3</td>33 <tr *ngFor="let head of heads"> 34 <td>{{head.Name}} | {{head.Email}}</td> 35 <td>{{head.Pharmacy[0].name}}</td> 36 <td><a (click)="Approve()">Approve</a> | <a (click)="Reject()">Reject</a></td> 37 37 </tr> 38 38 </tbody> 39 39 </table> 40 40 </div> 41 </div> 42 </mat-tab> 41 43 <mat-tab label="Manage accounts"> 42 44 <div class="wrapper"> … … 50 52 </thead> 51 53 <tbody> 52 <tr *ngFor=" ">53 <td> data1</td>54 <td> data2</td>54 <tr *ngFor="let head of heads"> 55 <td>{{head.Name}} | {{head.Email}}</td> 56 <td><a (click)="Del(head)">Delete</a> | <a (click)="ChangeDialog(head)">Change</a></td> 55 57 </tr> 56 58 </tbody> 57 59 </table> 60 </div> 58 61 </div> 62 </mat-tab> 59 63 <mat-tab label="Create new account"> 60 64 <div class="createform"> 61 65 <mat-form-field appearance="fill"> 62 66 <mat-label>Name</mat-label> 63 <input matInput >67 <input matInput [(ngModel)]="head.Name"> 64 68 </mat-form-field><br> 65 69 <mat-form-field appearance="fill"> 66 70 <mat-label>Email</mat-label> 67 <input matInput >71 <input matInput [(ngModel)]="head.Email"> 68 72 </mat-form-field><br> 69 73 <mat-form-field appearance="fill"> 70 74 <mat-label>Password</mat-label> 71 <input matInput >75 <input matInput [(ngModel)]="head.Passwd"> 72 76 </mat-form-field><br> 73 <button mat-raised-button color="primary">Create</button>77 <button onclick="createHead()" mat-raised-button color="primary">Create</button> 74 78 </div> 79 </mat-tab> 80 </mat-tab-group> 81 82 <div class="status">{{status}}</div> -
Farmatiko/ClientApp/src/app/admin/admin.component.ts
re42f61a rde18858 1 import { Component, OnInit } from '@angular/core'; 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'; 2 8 import { FormControl } from '@angular/forms'; 9 3 10 4 11 @Component({ … … 8 15 }) 9 16 export class AdminComponent implements OnInit { 17 public heads: PharmacyHead[]; 18 public head: PharmacyHead; 19 public status: string; 10 20 11 constructor() { } 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 } 12 27 13 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 14 62 } 15 63 -
Farmatiko/ClientApp/src/app/app.module.ts
re42f61a rde18858 11 11 import { HomeComponent } from './home/home.component'; 12 12 import { CounterComponent } from './counter/counter.component'; 13 import { FetchDataComponent } from './fetch-data/fetch-data.component';14 13 import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 15 14 import { KoronaComponent } from './korona/korona.component'; … … 24 23 HomeComponent, 25 24 CounterComponent, 26 FetchDataComponent,27 25 KoronaComponent, 28 26 AdminComponent, … … 37 35 { path: '', component: HomeComponent, pathMatch: 'full' }, 38 36 { path: 'mapa', component: CounterComponent }, 39 { path: 'fetch-data', component: FetchDataComponent },40 37 { path: 'koronavirus', component: KoronaComponent }, 41 38 { path: 'admin', component: AdminComponent }, -
Farmatiko/ClientApp/src/app/counter/counter.component.html
re42f61a rde18858 53 53 <h2>Здравствени работници</h2> 54 54 <mat-form-field> 55 <input matInput (keyup)="applyFilter ($event.target.value)" placeholder="Пронајди работник">55 <input matInput (keyup)="applyFilterWorkers($event.target.value)" placeholder="Пронајди работник"> 56 56 </mat-form-field> 57 57 </div> … … 77 77 </ng-container> 78 78 79 80 81 79 <tr mat-header-row *matHeaderRowDef="displayedColumnsWorkers"></tr> 82 80 <tr mat-row *matRowDef="let row; columns: displayedColumnsWorkers;"></tr> -
Farmatiko/ClientApp/src/app/counter/counter.component.ts
re42f61a rde18858 49 49 filterValue = filterValue.toLowerCase(); 50 50 this.dataSource.filter = filterValue; 51 } 52 53 applyFilterWorkers(filterValue: string) { 54 filterValue = filterValue.trim(); 55 filterValue = filterValue.toLowerCase(); 51 56 this.dataSourceWorkers.filter = filterValue; 52 57 } -
Farmatiko/ClientApp/src/app/dashboard/dashboard.component.html
re42f61a rde18858 12 12 <div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse"> 13 13 <ul class="navbar-nav flex-grow"> 14 <li>Logged as ...</li>14 <li>Logged as <!--{{head.Name}}--> </li> 15 15 </ul> 16 16 </div> … … 19 19 <mat-menu #menu="matMenu"> 20 20 <button mat-menu-item (click)="openDialog()"><mat-icon>person_add</mat-icon>View homepage</button> 21 <button mat-menu-item (click)="test()"><mat-icon> 21 <button mat-menu-item (click)="test()"><mat-icon>directions</mat-icon>Go to homepage</button> 22 22 </mat-menu> 23 23 </div> … … 30 30 <div class="header"> 31 31 <h2>Мои аптеки</h2> 32 <p *ngIf="!mypharmacies"><em>Loading...</em></p> 32 33 </div> 33 34 <table class='table table-striped table-bordered table-sm' cellspacing="0" width="100%" aria-labelledby="tableLabel" *ngIf="true"> 34 35 <thead> 35 36 <tr> 36 <th>Placeholder1</th> 37 <th>Placeholder2</th> 38 <th>Placeholder3</th> 39 <th>Placeholder4</th> 37 <th>Име</th> 38 <th>Локација</th> 39 <th>Адреса</th> 40 <th>Работи 24/7</th> 41 <th>Actions</th> 40 42 </tr> 41 43 </thead> 42 44 <tbody> 43 <tr *ngFor="let facility of facilities"> 44 <td>data1</td> 45 <td>data2</td> 46 <td>data3</td> 47 <td>data4</td> 45 <tr *ngFor="let pharmacies of mypharmacies"> 46 <td>{{pharmacies.name}}</td> 47 <td>{{pharmacies.location}}</td> 48 <td>{{pharmacies.address}}</td> 49 <td>{{pharmacies.workAllTime}}</td> 50 <td><a (click)="works24hrs(pharmacies)">Работи 24/7</a> | <a (click)="doesntWork24hrs(pharmacies)">Не работи 24/7</a></td> 48 51 </tr> 49 52 </tbody> … … 56 59 <h2>Сите аптеки</h2> 57 60 <mat-form-field> 58 <input matInput (keyup)="applyFilter ($event.target.value)" placeholder="Пронајди аптека">61 <input matInput (keyup)="applyFilterPharmacies($event.target.value)" placeholder="Пронајди аптека"> 59 62 </mat-form-field> 60 63 </div> 61 64 <table [dataSource]="dataSource" mat-table matSort class="mat-elevation-z8"> 62 <ng-container matColumnDef="Име"> 65 <ng-container matColumnDef="Име">a 63 66 <th mat-header-cell *matHeaderCellDef mat-sort-header> Име </th> 64 <td mat-cell *matCellDef="let facilities"> {{facilities.name}} </td>67 <td mat-cell *matCellDef="let pharmacies"> {{pharmacies.name}} </td> 65 68 </ng-container> 66 69 67 <ng-container matColumnDef=" Општина">68 <th mat-header-cell *matHeaderCellDef mat-sort-header> Општина </th>69 <td mat-cell *matCellDef="let facilities"> {{facilities.municipality}} </td>70 <ng-container matColumnDef="Локација"> 71 <th mat-header-cell *matHeaderCellDef mat-sort-header> Локација </th> 72 <td mat-cell *matCellDef="let pharmacies"> {{pharmacies.location}} </td> 70 73 </ng-container> 71 74 72 75 <ng-container matColumnDef="Адреса"> 73 76 <th mat-header-cell *matHeaderCellDef mat-sort-header> Адреса </th> 74 <td mat-cell *matCellDef="let facilities"> {{facilities.address}} </td>77 <td mat-cell *matCellDef="let pharmacies"> {{pharmacies.address}} </td> 75 78 </ng-container> 76 77 <ng-container matColumnDef="Тип"> 78 <th mat-header-cell *matHeaderCellDef mat-sort-header> Тип </th> 79 <td mat-cell *matCellDef="let facilities"> {{facilities.type}} </td> 80 </ng-container> 81 82 <ng-container matColumnDef="Е-пошта"> 83 <th mat-header-cell *matHeaderCellDef mat-sort-header> Е-пошта </th> 84 <td mat-cell *matCellDef="let facilities"> {{facilities.email}} </td> 85 </ng-container> 86 87 <ng-container matColumnDef="Телефон"> 88 <th mat-header-cell *matHeaderCellDef mat-sort-header> Телефон </th> 89 <td mat-cell *matCellDef="let facilities"> {{facilities.phone}} </td> 79 80 <ng-container matColumnDef="Actions"> 81 <th mat-header-cell *matHeaderCellDef mat-sort-header> Actions </th> 82 <td mat-cell *matCellDef="let pharmacies"> <a (click)="claimPharmacy(pharmacies)">Claim Pharmacy</a> </td> 90 83 </ng-container> 91 84 92 <tr mat-header-row *matHeaderRowDef="displayedColumns "></tr>93 <tr mat-row *matRowDef="let row; columns: displayedColumns ;"></tr>85 <tr mat-header-row *matHeaderRowDef="displayedColumnsPharmacies"></tr> 86 <tr mat-row *matRowDef="let row; columns: displayedColumnsPharmacies;"></tr> 94 87 </table> 95 88 <mat-paginator #paginator [pageSize]="5" [pageSizeOptions]="[5, 10, 20, 100]"></mat-paginator> … … 97 90 </mat-tab> 98 91 </mat-tab-group> 92 93 <div class="statusbar">{{status}}</div> 99 94 100 95 <div class="wrapper"> … … 104 99 <input matInput (keyup)="applyFilter($event.target.value)" placeholder="Пронајди лек"> 105 100 </mat-form-field> 106 </div>101 </div> 107 102 <table [dataSource]="dataSource" mat-table matSort class="mat-elevation-z8"> 108 103 <ng-container matColumnDef="Име"> 109 104 <th mat-header-cell *matHeaderCellDef mat-sort-header> Име </th> 110 <td mat-cell *matCellDef="let facilities"> {{facilities.name}} </td>105 <td mat-cell *matCellDef="let mymedicines"> {{mymedicines.name}} </td> 111 106 </ng-container> 112 107 113 <ng-container matColumnDef=" Општина">114 <th mat-header-cell *matHeaderCellDef mat-sort-header> Општина </th>115 <td mat-cell *matCellDef="let facilities"> {{facilities.municipality}} </td>108 <ng-container matColumnDef="Јачина"> 109 <th mat-header-cell *matHeaderCellDef mat-sort-header> Јачина </th> 110 <td mat-cell *matCellDef="let mymedicines"> {{mymedicines.strength}} </td> 116 111 </ng-container> 117 112 118 <ng-container matColumnDef=" Адреса">119 <th mat-header-cell *matHeaderCellDef mat-sort-header> Адреса </th>120 <td mat-cell *matCellDef="let facilities"> {{facilities.address}} </td>113 <ng-container matColumnDef="Форма"> 114 <th mat-header-cell *matHeaderCellDef mat-sort-header> Форма </th> 115 <td mat-cell *matCellDef="let mymedicines"> {{mymedicines.form}} </td> 121 116 </ng-container> 122 117 123 <ng-container matColumnDef=" Тип">124 <th mat-header-cell *matHeaderCellDef mat-sort-header> Тип</th>125 <td mat-cell *matCellDef="let facilities"> {{facilities.type}} </td>118 <ng-container matColumnDef="Начин на издавање"> 119 <th mat-header-cell *matHeaderCellDef mat-sort-header> Начин на издавање </th> 120 <td mat-cell *matCellDef="let mymedicines"> {{mymedicines.wayOfIssuing}} </td> 126 121 </ng-container> 127 122 128 <ng-container matColumnDef=" Е-пошта">129 <th mat-header-cell *matHeaderCellDef mat-sort-header> Е-пошта</th>130 <td mat-cell *matCellDef="let facilities"> {{facilities.email}} </td>123 <ng-container matColumnDef="Производител"> 124 <th mat-header-cell *matHeaderCellDef mat-sort-header> Производител </th> 125 <td mat-cell *matCellDef="let mymedicines"> {{mymedicines.manufacturer}} </td> 131 126 </ng-container> 132 127 133 <ng-container matColumnDef="Телефон"> 134 <th mat-header-cell *matHeaderCellDef mat-sort-header> Телефон </th> 135 <td mat-cell *matCellDef="let facilities"> {{facilities.phone}} </td> 128 <ng-container matColumnDef="Цена"> 129 <th mat-header-cell *matHeaderCellDef mat-sort-header> Цена </th> 130 <td mat-cell *matCellDef="let mymedicines"> {{mymedicines.price}} </td> 131 </ng-container> 132 133 <ng-container matColumnDef="Пакување"> 134 <th mat-header-cell *matHeaderCellDef mat-sort-header> Пакување </th> 135 <td mat-cell *matCellDef="let mymedicines"> {{mymedicines.packaging}} </td> 136 </ng-container> 137 138 <ng-container matColumnDef="Actions"> 139 <th mat-header-cell *matHeaderCellDef mat-sort-header> Actions </th> 140 <td mat-cell *matCellDef="let mymedicines"> <a (click)="medicineExists(mymedicines)">Exists</a> | <a (click)="medicineDoesntSell(mymedicines)">Doesnt sell</a> </td> 136 141 </ng-container> 137 142 -
Farmatiko/ClientApp/src/app/dashboard/dashboard.component.ts
re42f61a rde18858 4 4 import { MatPaginator } from '@angular/material/paginator'; 5 5 import { MatSort } from '@angular/material/sort'; 6 import { HealthFacilities } from '../models/HealthFacilities';7 6 import { HttpClient } from '@angular/common/http'; 8 7 import { MatDialog } from '@angular/material/dialog'; … … 10 9 import { Router, RouterModule } from '@angular/router'; 11 10 import { HomeComponent } from '../home/home.component'; 11 import { Medicine } from '../models/Medicine'; 12 import { PharmacyHead } from '../models/PharmacyHead'; 13 import { MedicineList } from '../models/MedicineList'; 12 14 13 15 @Component({ … … 17 19 }) 18 20 export class DashboardComponent implements OnInit { 19 public facilities: HealthFacilities[]; 20 displayedColumns = ['Име','Општина','Адреса', 'Тип', 'Е-пошта', 'Телефон']; 21 dataSource = new MatTableDataSource<HealthFacilities>(); 21 public mymedicines: Medicine[]; 22 public hasmymedicines: boolean[]; 23 public pharmacies: Pharmacy[]; 24 public mypharmacies: Pharmacy[]; 25 public head: PharmacyHead; 26 public status: string; 27 displayedColumns = ['Име','Јачина','Форма', 'Начин на издавање', 'Производител', 'Цена', 'Пакување', 'Actions']; 28 displayedColumnsPharmacies = ['Име','Локација','Адреса', 'Actions']; 29 dataSource = new MatTableDataSource<Medicine>(); 30 dataSourcePharmacies = new MatTableDataSource<Pharmacy>(); 22 31 23 32 @ViewChild(MatPaginator, {static: true}) paginator: MatPaginator; … … 25 34 26 35 constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string, private dialog: MatDialog, private _snackBar: MatSnackBar, private router: Router) { 27 http.get<HealthFacilities[]>(baseUrl + 'HealthFacilities/Get?').subscribe(result => { 28 this.facilities = result; 29 console.log(this.facilities); 30 this.dataSource = new MatTableDataSource<HealthFacilities>(this.facilities); 36 http.get<PharmacyHead>(baseUrl + 'PharmacyHead/GetLoggedHead?').subscribe(result => { 37 this.head = result; 38 console.log(this.head); 39 this.mymedicines = this.head.PharmacyMedicines.Medicines; 40 console.log(this.mymedicines); 41 this.mypharmacies = this.head.Pharmacy; 42 console.log(this.mypharmacies); 43 this.dataSource = new MatTableDataSource<Medicine>(this.mymedicines); 44 }, error => console.error(error)); 45 http.get<Pharmacy[]>(baseUrl + 'Pharmacy/Get?').subscribe(result => { 46 this.pharmacies = result; 47 console.log(this.pharmacies); 48 this.dataSourcePharmacies = new MatTableDataSource<Pharmacy>(this.pharmacies); 31 49 }, error => console.error(error)); 32 50 } 51 33 52 ngOnInit(): void { 34 53 } … … 37 56 this.dataSource.paginator = this.paginator; 38 57 this.dataSource.sort = this.sort; 58 this.dataSourcePharmacies.paginator = this.paginator; 59 this.dataSourcePharmacies.sort = this.sort; 60 } 61 62 works24hrs(pharmacy: Pharmacy) { 63 console.log(pharmacy); 64 // post request vo prodolzenie 65 66 this.status="Status bar works24hrs"; 67 } 68 69 doesntWork24hrs(pharmacy: Pharmacy) { 70 console.log(pharmacy); 71 // post request vo prodolzenie 72 73 this.status="Status bar doesntWork24hrs"; 74 } 75 76 claimPharmacy(pharmacy: Pharmacy) { 77 console.log(pharmacy); 78 // post request vo prodolzenie 79 80 this.status="Status bar claimPharmacy"; 81 } 82 83 medicineExists(mymedicine: Medicine) { 84 console.log(mymedicine); 85 // post request vo prodolzenie 86 87 this.status="Status bar medicineexists"; 88 } 89 90 medicineDoesntSell(mymedicine: Medicine) { 91 console.log(mymedicine); 92 // post request vo prodolzenie 93 94 this.status="Status bar medicineDoesntSell"; 39 95 } 40 96 … … 44 100 this.dataSource.filter = filterValue; 45 101 } 102 103 applyFilterPharmacies(filterValue: string) { 104 filterValue = filterValue.trim(); 105 filterValue = filterValue.toLowerCase(); 106 this.dataSourcePharmacies.filter = filterValue; 107 } 108 46 109 test(): void { 47 110 console.log('Snackbar works!'); -
Farmatiko/ClientApp/src/app/home/home.component.html
re42f61a rde18858 13 13 <ng-container matColumnDef="Име"> 14 14 <th mat-header-cell *matHeaderCellDef mat-sort-header> Име </th> 15 <td mat-cell *matCellDef="let facilities"> {{facilities.name}} </td>15 <td mat-cell *matCellDef="let medicines"> {{medicines.name}} </td> 16 16 </ng-container> 17 17 18 <ng-container matColumnDef=" Општина">19 <th mat-header-cell *matHeaderCellDef mat-sort-header> Општина </th>20 <td mat-cell *matCellDef="let facilities"> {{facilities.municipality}} </td>18 <ng-container matColumnDef="Јачина"> 19 <th mat-header-cell *matHeaderCellDef mat-sort-header> Јачина </th> 20 <td mat-cell *matCellDef="let medicines"> {{medicines.strength}} </td> 21 21 </ng-container> 22 22 23 <ng-container matColumnDef=" Адреса">24 <th mat-header-cell *matHeaderCellDef mat-sort-header> Адреса </th>25 <td mat-cell *matCellDef="let facilities"> {{facilities.address}} </td>23 <ng-container matColumnDef="Форма"> 24 <th mat-header-cell *matHeaderCellDef mat-sort-header> Форма </th> 25 <td mat-cell *matCellDef="let medicines"> {{medicines.form}} </td> 26 26 </ng-container> 27 27 28 <ng-container matColumnDef=" Тип">29 <th mat-header-cell *matHeaderCellDef mat-sort-header> Тип</th>30 <td mat-cell *matCellDef="let facilities"> {{facilities.type}} </td>28 <ng-container matColumnDef="Начин на издавање"> 29 <th mat-header-cell *matHeaderCellDef mat-sort-header> Начин на издавање </th> 30 <td mat-cell *matCellDef="let medicines"> {{medicines.wayOfIssuing}} </td> 31 31 </ng-container> 32 32 33 <ng-container matColumnDef=" Е-пошта">34 <th mat-header-cell *matHeaderCellDef mat-sort-header> Е-пошта</th>35 <td mat-cell *matCellDef="let facilities"> {{facilities.email}} </td>33 <ng-container matColumnDef="Производител"> 34 <th mat-header-cell *matHeaderCellDef mat-sort-header> Производител </th> 35 <td mat-cell *matCellDef="let medicines"> {{medicines.manufacturer}} </td> 36 36 </ng-container> 37 37 38 <ng-container matColumnDef="Телефон"> 39 <th mat-header-cell *matHeaderCellDef mat-sort-header> Телефон </th> 40 <td mat-cell *matCellDef="let facilities"> {{facilities.phone}} </td> 38 <ng-container matColumnDef="Цена"> 39 <th mat-header-cell *matHeaderCellDef mat-sort-header> Цена </th> 40 <td mat-cell *matCellDef="let medicines"> {{medicines.price}} </td> 41 </ng-container> 42 43 <ng-container matColumnDef="Пакување"> 44 <th mat-header-cell *matHeaderCellDef mat-sort-header> Пакување </th> 45 <td mat-cell *matCellDef="let medicines"> {{medicines.packaging}} </td> 41 46 </ng-container> 42 47 … … 52 57 <h2>Аптеки</h2> 53 58 <mat-form-field> 54 <input matInput (keyup)="applyFilter ($event.target.value)" placeholder="Пронајди аптека">59 <input matInput (keyup)="applyFilterPharmacies($event.target.value)" placeholder="Пронајди аптека"> 55 60 </mat-form-field> 56 61 </div> 57 62 <table [dataSource]="dataSource" mat-table matSort class="mat-elevation-z8"> 58 <ng-container matColumnDef="Име"> 63 <ng-container matColumnDef="Име">a 59 64 <th mat-header-cell *matHeaderCellDef mat-sort-header> Име </th> 60 <td mat-cell *matCellDef="let facilities"> {{facilities.name}} </td>65 <td mat-cell *matCellDef="let pharmacies"> {{pharmacies.name}} </td> 61 66 </ng-container> 62 67 63 <ng-container matColumnDef=" Општина">64 <th mat-header-cell *matHeaderCellDef mat-sort-header> Општина </th>65 <td mat-cell *matCellDef="let facilities"> {{facilities.municipality}} </td>68 <ng-container matColumnDef="Локација"> 69 <th mat-header-cell *matHeaderCellDef mat-sort-header> Локација </th> 70 <td mat-cell *matCellDef="let pharmacies"> {{pharmacies.location}} </td> 66 71 </ng-container> 67 72 68 73 <ng-container matColumnDef="Адреса"> 69 74 <th mat-header-cell *matHeaderCellDef mat-sort-header> Адреса </th> 70 <td mat-cell *matCellDef="let facilities"> {{facilities.address}} </td>75 <td mat-cell *matCellDef="let pharmacies"> {{pharmacies.address}} </td> 71 76 </ng-container> 72 77 73 <ng-container matColumnDef="Тип"> 74 <th mat-header-cell *matHeaderCellDef mat-sort-header> Тип </th> 75 <td mat-cell *matCellDef="let facilities"> {{facilities.type}} </td> 76 </ng-container> 77 78 <ng-container matColumnDef="Е-пошта"> 79 <th mat-header-cell *matHeaderCellDef mat-sort-header> Е-пошта </th> 80 <td mat-cell *matCellDef="let facilities"> {{facilities.email}} </td> 81 </ng-container> 82 83 <ng-container matColumnDef="Телефон"> 84 <th mat-header-cell *matHeaderCellDef mat-sort-header> Телефон </th> 85 <td mat-cell *matCellDef="let facilities"> {{facilities.phone}} </td> 78 <ng-container matColumnDef="Работи 27/7?"> 79 <th mat-header-cell *matHeaderCellDef mat-sort-header> Работи 27/7? </th> 80 <td mat-cell *matCellDef="let pharmacies"> {{pharmacies.workAllTime}} </td> 86 81 </ng-container> 87 82 88 <tr mat-header-row *matHeaderRowDef="displayedColumns "></tr>89 <tr mat-row *matRowDef="let row; columns: displayedColumns ;"></tr>83 <tr mat-header-row *matHeaderRowDef="displayedColumnsPharmacies"></tr> 84 <tr mat-row *matRowDef="let row; columns: displayedColumnsPharmacies;"></tr> 90 85 </table> 91 86 <mat-paginator #paginator [pageSize]="5" [pageSizeOptions]="[5, 10, 20, 100]"></mat-paginator> -
Farmatiko/ClientApp/src/app/home/home.component.ts
re42f61a rde18858 1 1 import { Component, OnInit, ViewChild, Inject } from '@angular/core'; 2 2 import { HttpClient } from '@angular/common/http'; 3 import { HealthFacilities } from '../models/HealthFacilities'; 3 import { Medicine } from '../models/Medicine'; 4 import { Pharmacy } from '../models/Pharmacy'; 4 5 import { MatTableDataSource } from '@angular/material/table'; 5 6 import { MatPaginator } from '@angular/material/paginator'; 6 7 import { MatSort } from '@angular/material/sort'; 7 8 8 9 9 @Component({ … … 13 13 }) 14 14 export class HomeComponent implements OnInit { 15 public facilities: HealthFacilities[]; 16 displayedColumns = ['Име','Општина','Адреса', 'Тип', 'Е-пошта', 'Телефон']; 17 dataSource = new MatTableDataSource<HealthFacilities>(); 15 public medicines: Medicine[]; 16 public pharmacies: Pharmacy[]; 17 displayedColumns = ['Име','Јачина','Форма', 'Начин на издавање', 'Производител', 'Цена', 'Пакување']; 18 displayedColumnsPharmacies = ['Име','Локација','Адреса', 'Работи 27/7?']; 19 dataSource = new MatTableDataSource<Medicine>(); 20 dataSourcePharmacies = new MatTableDataSource<Pharmacy>(); 18 21 19 22 @ViewChild(MatPaginator, {static: true}) paginator: MatPaginator; … … 21 24 22 25 constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string) { 23 http.get<HealthFacilities[]>(baseUrl + 'HealthFacilities/Get?').subscribe(result => { 24 this.facilities = result; 25 console.log(this.facilities); 26 this.dataSource = new MatTableDataSource<HealthFacilities>(this.facilities); 26 http.get<Medicine[]>(baseUrl + 'Medicine/Get?').subscribe(result => { 27 this.medicines = result; 28 console.log(this.medicines); 29 this.dataSource = new MatTableDataSource<Medicine>(this.medicines); 30 }, error => console.error(error)); 31 http.get<Pharmacy[]>(baseUrl + 'Pharmacy/Get?').subscribe(result => { 32 this.pharmacies = result; 33 console.log(this.pharmacies); 34 this.dataSourcePharmacies = new MatTableDataSource<Pharmacy>(this.pharmacies); 27 35 }, error => console.error(error)); 28 36 } … … 33 41 this.dataSource.paginator = this.paginator; 34 42 this.dataSource.sort = this.sort; 43 this.dataSourcePharmacies.paginator = this.paginator; 44 this.dataSourcePharmacies.sort = this.sort; 35 45 } 36 46 … … 40 50 this.dataSource.filter = filterValue; 41 51 } 52 53 applyFilterPharmacies(filterValue: string) { 54 filterValue = filterValue.trim(); 55 filterValue = filterValue.toLowerCase(); 56 this.dataSourcePharmacies.filter = filterValue; 57 } 42 58 } -
Farmatiko/ClientApp/src/app/korona/korona.component.html
re42f61a rde18858 8 8 <p>статистика</p> 9 9 </div> 10 11 12 13 10 </div> 14 11 <div class="row text-center pads"> 15 12 <div class="col"> 16 13 <div class="counter"> 17 <i class="fa fa-code fa-2x" >0</i>18 <h2 class="timer count-title count-number" data-to="100" data-speed="1500"></h2>14 <i class="fa fa-code fa-2x" *ngIf="korona">{{korona.totalMK}}</i> 15 <h2 class="timer count-title count-number"></h2> 19 16 <p class="count-text ">Вкупно случаи во земјата</p> 20 17 </div> … … 22 19 <div class="col"> 23 20 <div class="counter"> 24 <i class="fa fa-coffee fa-2x" >0</i>25 <h2 class="timer count-title count-number" data-to="1700" data-speed="1500"></h2>21 <i class="fa fa-coffee fa-2x" *ngIf="korona">{{korona.activeMK}}</i> 22 <h2 class="timer count-title count-number"></h2> 26 23 <p class="count-text ">Активни случаи во земјата</p> 27 24 </div> … … 29 26 <div class="col"> 30 27 <div class="counter"> 31 <i class="fa fa-lightbulb-o fa-2x" >0</i>32 <h2 class="timer count-title count-number" data-to="11900" data-speed="1500"></h2>28 <i class="fa fa-lightbulb-o fa-2x" *ngIf="korona">{{korona.deathsMK}}</i> 29 <h2 class="timer count-title count-number"></h2> 33 30 <p class="count-text ">Смртни случаи во земјата</p> 34 31 </div> … … 36 33 <div class="col"> 37 34 <div class="counter"> 38 <i class="fa fa-bug fa-2x" >0</i>39 <h2 class="timer count-title count-number" data-to="157" data-speed="1500"></h2>35 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona.newMK}}</i> 36 <h2 class="timer count-title count-number"></h2> 40 37 <p class="count-text ">Нови случаи во земјата</p> 41 38 </div> … … 45 42 <div class="col"> 46 43 <div class="counter"> 47 <i class="fa fa-bug fa-2x" >0</i>48 <h2 class="timer count-title count-number" data-to="157" data-speed="1500"></h2>44 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona.totalGlobal}}</i> 45 <h2 class="timer count-title count-number"></h2> 49 46 <p class="count-text ">Вкупно случаи глобално</p> 50 47 </div> … … 52 49 <div class="col"> 53 50 <div class="counter"> 54 <i class="fa fa-bug fa-2x" >0</i>55 <h2 class="timer count-title count-number" data-to="157" data-speed="1500"></h2>51 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona.activeGlobal}}</i> 52 <h2 class="timer count-title count-number"></h2> 56 53 <p class="count-text ">Активни случаи глобално</p> 57 54 </div> … … 59 56 <div class="col"> 60 57 <div class="counter"> 61 <i class="fa fa-bug fa-2x" >0</i>62 <h2 class="timer count-title count-number" data-to="157" data-speed="1500"></h2>58 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona.deathsGlobal}}</i> 59 <h2 class="timer count-title count-number"></h2> 63 60 <p class="count-text ">Смртни случаи глобално</p> 64 61 </div> -
Farmatiko/ClientApp/src/app/korona/korona.component.ts
re42f61a rde18858 1 import { Component, OnInit } from '@angular/core'; 1 import { Component, OnInit, Inject } from '@angular/core'; 2 import { Pandemic } from '../models/Pandemic'; 3 import { MatTableDataSource } from '@angular/material/table'; 4 import { HttpClient } from '@angular/common/http'; 2 5 3 6 @Component({ … … 7 10 }) 8 11 export class KoronaComponent implements OnInit { 12 public korona: Pandemic; 9 13 10 constructor() { } 14 constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string) { 15 http.get<Pandemic>(baseUrl + 'Pandemic/Get?').subscribe(result => { 16 this.korona = result; 17 console.log(this.korona); 18 }, error => console.error(error)); 19 } 11 20 12 21 ngOnInit(): void { -
Farmatiko/ClientApp/src/app/models/HealthcareWorkers.ts
re42f61a rde18858 2 2 3 3 export class HealthcareWorkers { 4 Name: string;5 Branch: Date;6 Facility: HealthFacilities;7 Title: string;4 name: string; 5 branch: Date; 6 facility: HealthFacilities; 7 title: string; 8 8 } -
Farmatiko/ClientApp/src/app/models/Medicine.ts
re42f61a rde18858 1 1 export class Medicine { 2 Name: string;3 Strength: string;4 Form: string;5 WayOfIssuing: string;6 Manufacturer: string;7 Price: Float32Array;8 Packaging: string;2 name: string; 3 strength: string; 4 form: string; 5 wayOfIssuing: string; 6 manufacturer: string; 7 price: number; 8 packaging: string; 9 9 } -
Farmatiko/ClientApp/src/app/models/Pandemic.ts
re42f61a rde18858 1 1 export class Pandemic { 2 Name: string;3 TotalMK: number;4 ActiveMK: number;5 DeathsMK: number;6 NewMK: number;7 TotalGlobal: number;8 DeathsGlobal: number;9 ActiveGlobal: number;2 name: string; 3 totalMK: number; 4 activeMK: number; 5 deathsMK: number; 6 newMK: number; 7 totalGlobal: number; 8 deathsGlobal: number; 9 activeGlobal: number; 10 10 } -
Farmatiko/ClientApp/src/app/models/Pharmacy.ts
re42f61a rde18858 1 1 export class Pharmacy { 2 Name: string;3 Location: string;4 Address: string;5 WorkAllTime: boolean;2 name: string; 3 location: string; 4 address: string; 5 workAllTime: boolean; 6 6 }
Note:
See TracChangeset
for help on using the changeset viewer.