Changeset 5d02859
- Timestamp:
- 09/30/20 10:37:22 (4 years ago)
- Branches:
- master
- Children:
- 1454207
- Parents:
- 63d885e
- Files:
-
- 5 added
- 6 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/korona/korona.component.html
r63d885e r5d02859 1 1 <app-nav-menu></app-nav-menu> 2 2 3 <div class="container" >3 <div class="container" *ngIf="korona"> 4 4 <div class="row"> 5 5 <br /> 6 6 <div class="col text-center"> 7 <h2> Коронавирус</h2>7 <h2>{{korona[0].name}}</h2> 8 8 <p>статистика</p> 9 9 </div> … … 11 11 <div class="row text-center pads"> 12 12 <div class="col"> 13 <div class="counter" >14 <i class="fa fa-code fa-2x" *ngIf="korona">{{korona.totalMK}}</i>13 <div class="counter" *ngIf="korona"> 14 <i class="fa fa-code fa-2x">{{korona[0].totalMK}}</i> 15 15 <h2 class="timer count-title count-number"></h2> 16 16 <p class="count-text ">Вкупно случаи во земјата</p> … … 18 18 </div> 19 19 <div class="col"> 20 <div class="counter" >21 <i class="fa fa-coffee fa-2x" *ngIf="korona">{{korona.activeMK}}</i>20 <div class="counter" *ngIf="korona"> 21 <i class="fa fa-coffee fa-2x">{{korona[0].activeMK}}</i> 22 22 <h2 class="timer count-title count-number"></h2> 23 23 <p class="count-text ">Активни случаи во земјата</p> … … 25 25 </div> 26 26 <div class="col"> 27 <div class="counter" >28 <i class="fa fa-lightbulb-o fa-2x" *ngIf="korona">{{korona.deathsMK}}</i>27 <div class="counter" *ngIf="korona"> 28 <i class="fa fa-lightbulb-o fa-2x">{{korona[0].deathsMK}}</i> 29 29 <h2 class="timer count-title count-number"></h2> 30 30 <p class="count-text ">Смртни случаи во земјата</p> … … 32 32 </div> 33 33 <div class="col"> 34 <div class="counter" >35 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona.newMK}}</i>34 <div class="counter" *ngIf="korona"> 35 <i class="fa fa-bug fa-2x">{{korona[0].newMK}}</i> 36 36 <h2 class="timer count-title count-number"></h2> 37 37 <p class="count-text ">Нови случаи во земјата</p> … … 41 41 <div class="row text-center pads"> 42 42 <div class="col"> 43 <div class="counter" >44 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona.totalGlobal}}</i>43 <div class="counter" *ngIf="korona"> 44 <i class="fa fa-bug fa-2x">{{korona[0].totalGlobal}}</i> 45 45 <h2 class="timer count-title count-number"></h2> 46 46 <p class="count-text ">Вкупно случаи глобално</p> … … 48 48 </div> 49 49 <div class="col"> 50 <div class="counter" >51 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona.activeGlobal}}</i>50 <div class="counter" *ngIf="korona"> 51 <i class="fa fa-bug fa-2x">{{korona[0].activeGlobal}}</i> 52 52 <h2 class="timer count-title count-number"></h2> 53 53 <p class="count-text ">Активни случаи глобално</p> … … 55 55 </div> 56 56 <div class="col"> 57 <div class="counter" >58 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona.deathsGlobal}}</i>57 <div class="counter" *ngIf="korona"> 58 <i class="fa fa-bug fa-2x">{{korona[0].deathsGlobal}}</i> 59 59 <h2 class="timer count-title count-number"></h2> 60 60 <p class="count-text ">Смртни случаи глобално</p> -
Farmatiko/ClientApp/src/app/korona/korona.component.ts
r63d885e r5d02859 9 9 }) 10 10 export class KoronaComponent implements OnInit { 11 public korona: IPandemic ;11 public korona: IPandemic[]; 12 12 13 13 constructor(private dataService: DataService) { … … 17 17 ngOnInit(): void { 18 18 this.dataService.getPandemic() 19 .subscribe((res: IPandemic ) => {19 .subscribe((res: IPandemic[]) => { 20 20 this.korona = res; 21 console.log(this.korona); 21 22 }, 22 23 (err: any) => console.log(err), -
Farmatiko/ClientApp/src/app/shared/data.service.ts
r63d885e r5d02859 11 11 baseFacilitiesUrl: string = '/api/facilities'; 12 12 baseWorkersUrl: string = '/api/workers'; 13 baseMedicineUrl: string = '/api/medicine ';13 baseMedicineUrl: string = '/api/medicines'; 14 14 basePandemicUrl: string = '/api/pandemic'; 15 15 basePharmacyUrl: string = '/api/pharmacy'; 16 16 basePharmacyHead: string = '/api/pharmacyhead'; 17 17 18 constructor(private http: HttpClient) { 18 constructor(private http: HttpClient) { 19 19 20 20 } … … 44 44 } 45 45 46 46 47 47 //Worker GET 48 48 getWorkers() : Observable<IHealthcareWorkers[]> { … … 69 69 } 70 70 71 71 72 72 //Medicine GET 73 73 getMedicines() : Observable<IMedicine[]> { … … 95 95 96 96 97 getPandemic() : Observable<IPandemic > {98 return this.http.get<IPandemic >(this.basePandemicUrl)97 getPandemic() : Observable<IPandemic[]> { 98 return this.http.get<IPandemic[]>(this.basePandemicUrl) 99 99 .pipe(catchError(this.handleError)); 100 100 } … … 179 179 //PharmacyHead PUT 180 180 updatePharmacyHead(head: IPharmacyHead) : Observable<IPharmacyHead> { 181 return this.http.put<IPharmacyHead>(this.basePharmacyHead + '/' + head.id, head) 181 return this.http.put<IPharmacyHead>(this.basePharmacyHead + '/' + head.id, head) 182 182 .pipe( 183 183 map((data) => { … … 198 198 199 199 private handleError(error: HttpErrorResponse) { 200 console.error('server error:', error); 200 console.error('server error:', error); 201 201 if (error.error instanceof Error) { 202 202 let errMessage = error.error.message; -
Farmatiko/Controllers/PharmacyHeadController.cs
r63d885e r5d02859 7 7 { 8 8 [ApiController] 9 [Route(" [controller]/[action]")]9 [Route("api/[action]")] 10 10 public class PharmacyHeadController : Controller 11 11 { 12 private IPharmacyHeadRepository _pharmacyHeadRepository;12 private readonly IPharmacyHeadRepository _pharmacyHeadRepository; 13 13 public PharmacyHeadController(IPharmacyHeadRepository pharmacyHeadRepository) 14 14 { -
FarmatikoData/FarmatikoDataContext.cs
r63d885e r5d02859 9 9 10 10 11 public DbSet<HealthFacilities> HealthFacilities { get; set; }12 public DbSet<HealthcareWorkers> HealthcareWorkers { get; set; }13 public DbSet<Pharmacy> Pharmacies { get; set; }14 public DbSet<PharmacyHead> PharmacyHeads { get; set; }11 public virtual DbSet<HealthFacilities> HealthFacilities { get; set; } 12 public virtual DbSet<HealthcareWorkers> HealthcareWorkers { get; set; } 13 public virtual DbSet<Pharmacy> Pharmacies { get; set; } 14 public virtual DbSet<PharmacyHead> PharmacyHeads { get; set; } 15 15 public virtual DbSet<Pandemic> Pandemics { get; set; } 16 16 public virtual DbSet<Medicine> Medicines { get; set; } -
FarmatikoData/Models/Medicine.cs
r63d885e r5d02859 1 1 using FarmatikoData.Base; 2 using System.ComponentModel.DataAnnotations; 2 3 3 4 namespace FarmatikoData.Models … … 6 7 { 7 8 public Medicine() { } 9 [Required] 8 10 public string Name { get; set; } 11 [Required] 9 12 public string Strength { get; set; } 10 13 public string Form { get; set; } 14 [Required] 11 15 public string WayOfIssuing { get; set; } 16 [Required] 12 17 public string Manufacturer { get; set; } 13 18 public float Price { get; set; } -
FarmatikoData/Models/MedicineList.cs
r63d885e r5d02859 1 1 using System.Collections.Generic; 2 using System.ComponentModel.DataAnnotations; 2 3 using FarmatikoData.Base; 3 4 using FarmatikoData.Models; … … 11 12 { 12 13 } 14 [Required] 13 15 public Medicine Medicine { get; set; } 16 [Required] 14 17 public bool HasMedicine { get; set; } 15 18 public MedicineList(Medicine Medicine, bool HasMedicine) -
FarmatikoData/Models/Pandemic.cs
r63d885e r5d02859 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.ComponentModel.DataAnnotations; 3 4 using System.Text; 4 5 using FarmatikoData.Base; … … 10 11 { 11 12 public Pandemic() { } 13 [Required] 12 14 public string Name { get; set; } 15 [Required] 13 16 public int TotalMK { get; set; } 17 [Required] 14 18 public int ActiveMK { get; set; } 19 [Required] 15 20 public int DeathsMK { get; set; } 21 [Required] 16 22 public int NewMK { get; set; } 23 [Required] 17 24 public long TotalGlobal { get; set; } 25 [Required] 18 26 public long DeathsGlobal { get; set; } 27 [Required] 19 28 public long ActiveGlobal { get; set; } 20 29 public Pandemic(string Name, int TotalMK, int ActiveMK, -
FarmatikoData/Models/Pharmacy.cs
r63d885e r5d02859 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.ComponentModel.DataAnnotations; 3 4 using System.Text; 4 5 using FarmatikoData.Base; … … 10 11 { 11 12 public Pharmacy() { } 13 [Required] 12 14 public string Name { get; set; } 15 [Required] 13 16 public string Location { get; set; } 17 [Required] 14 18 public string Address { get; set; } 19 [Required] 15 20 public bool WorkAllTime { get; set; } 16 21 public Pharmacy(string Name, string Location, string Address, bool WorkAllTime) -
FarmatikoData/Models/PharmacyHead.cs
r63d885e r5d02859 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.ComponentModel.DataAnnotations; 3 4 using System.Text; 4 5 using FarmatikoData.Base; … … 9 10 public class PharmacyHead : BaseEntity 10 11 { 11 public MedicineList PharmacyMedicines { get; set; } 12 public Pharmacy Pharmacy { get; set; } 12 public PharmacyHead() 13 { 14 } 15 [Required] 13 16 public string Email { get; set; } 17 [Required] 14 18 public string Name { get; set; } 19 [Required] 15 20 public string Password { get; set; } 16 21 public ICollection<MedicineList> MedicineLists { get; set; } 17 22 public ICollection<Pharmacy> PharmaciesList { get; set; } 18 public PharmacyHead() 19 { 20 PharmaciesList = new HashSet<Pharmacy>(); 21 MedicineLists = new HashSet<MedicineList>(); 22 } 23 23 24 } 24 25 }
Note:
See TracChangeset
for help on using the changeset viewer.