Changeset e42f61a
- Timestamp:
- 07/29/20 13:21:48 (4 years ago)
- Branches:
- master
- Children:
- de18858
- Parents:
- ef1219a
- Files:
-
- 8 added
- 1 deleted
- 28 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/package.json
ref1219a re42f61a 4 4 "scripts": { 5 5 "ng": "ng", 6 "start": "ng serve -o",6 "start": "ng serve", 7 7 "build": "ng build", 8 8 "build:ssr": "ng run Farmatiko:server:dev", -
Farmatiko/ClientApp/src/app/counter/counter.component.html
ref1219a re42f61a 3 3 4 4 <mat-tab-group mat-stretch-tabs> 5 <mat-tab class="tab" label="Здравствени установи"> 5 <mat-tab class="tab" label="Здравствени установи"> 6 6 <div class="wrapper"> 7 7 <div class="header"> … … 16 16 <td mat-cell *matCellDef="let facilities"> {{facilities.name}} </td> 17 17 </ng-container> 18 18 19 19 <ng-container matColumnDef="Општина"> 20 20 <th mat-header-cell *matHeaderCellDef mat-sort-header> Општина </th> 21 21 <td mat-cell *matCellDef="let facilities"> {{facilities.municipality}} </td> 22 22 </ng-container> 23 23 24 24 <ng-container matColumnDef="Адреса"> 25 25 <th mat-header-cell *matHeaderCellDef mat-sort-header> Адреса </th> 26 26 <td mat-cell *matCellDef="let facilities"> {{facilities.address}} </td> 27 27 </ng-container> 28 28 29 29 <ng-container matColumnDef="Тип"> 30 30 <th mat-header-cell *matHeaderCellDef mat-sort-header> Тип </th> 31 31 <td mat-cell *matCellDef="let facilities"> {{facilities.type}} </td> 32 32 </ng-container> 33 33 34 34 <ng-container matColumnDef="Е-пошта"> 35 35 <th mat-header-cell *matHeaderCellDef mat-sort-header> Е-пошта </th> 36 36 <td mat-cell *matCellDef="let facilities"> {{facilities.email}} </td> 37 37 </ng-container> 38 38 39 39 <ng-container matColumnDef="Телефон"> 40 40 <th mat-header-cell *matHeaderCellDef mat-sort-header> Телефон </th> … … 48 48 </div> 49 49 </mat-tab> 50 <mat-tab class="tab" label="Здравствени работници"> 50 <mat-tab class="tab" label="Здравствени работници"> 51 51 <div class="wrapper"> 52 52 <div class="header"> … … 56 56 </mat-form-field> 57 57 </div> 58 <table [dataSource]="dataSource " mat-table matSort class="mat-elevation-z8">58 <table [dataSource]="dataSourceWorkers" mat-table matSort class="mat-elevation-z8"> 59 59 <ng-container matColumnDef="Име"> 60 60 <th mat-header-cell *matHeaderCellDef mat-sort-header> Име </th> 61 <td mat-cell *matCellDef="let facilities"> {{facilities.name}} </td>61 <td mat-cell *matCellDef="let workers"> {{workers.name}} </td> 62 62 </ng-container> 63 64 <ng-container matColumnDef=" Општина">65 <th mat-header-cell *matHeaderCellDef mat-sort-header> Општина </th>66 <td mat-cell *matCellDef="let facilities"> {{facilities.municipality}} </td>63 64 <ng-container matColumnDef="Гранка"> 65 <th mat-header-cell *matHeaderCellDef mat-sort-header> Гранка </th> 66 <td mat-cell *matCellDef="let workers"> {{workers.branch}} </td> 67 67 </ng-container> 68 69 <ng-container matColumnDef=" Адреса">70 <th mat-header-cell *matHeaderCellDef mat-sort-header> Адреса </th>71 <td mat-cell *matCellDef="let facilities"> {{facilities.address}} </td>68 69 <ng-container matColumnDef="Установа"> 70 <th mat-header-cell *matHeaderCellDef mat-sort-header> Установа </th> 71 <td mat-cell *matCellDef="let workers"> {{workers.facility}} </td> 72 72 </ng-container> 73 74 <ng-container matColumnDef=" Тип">75 <th mat-header-cell *matHeaderCellDef mat-sort-header> Тип</th>76 <td mat-cell *matCellDef="let facilities"> {{facilities.type}} </td>73 74 <ng-container matColumnDef="Назив"> 75 <th mat-header-cell *matHeaderCellDef mat-sort-header> Назив </th> 76 <td mat-cell *matCellDef="let workers"> {{workers.title}} </td> 77 77 </ng-container> 78 79 <ng-container matColumnDef="Е-пошта"> 80 <th mat-header-cell *matHeaderCellDef mat-sort-header> Е-пошта </th> 81 <td mat-cell *matCellDef="let facilities"> {{facilities.email}} </td> 82 </ng-container> 83 84 <ng-container matColumnDef="Телефон"> 85 <th mat-header-cell *matHeaderCellDef mat-sort-header> Телефон </th> 86 <td mat-cell *matCellDef="let facilities"> {{facilities.phone}} </td> 87 </ng-container> 88 89 <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> 90 <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> 78 79 80 81 <tr mat-header-row *matHeaderRowDef="displayedColumnsWorkers"></tr> 82 <tr mat-row *matRowDef="let row; columns: displayedColumnsWorkers;"></tr> 91 83 </table> 92 84 <mat-paginator #paginator [pageSize]="5" [pageSizeOptions]="[5, 10, 20, 100]"></mat-paginator> -
Farmatiko/ClientApp/src/app/counter/counter.component.ts
ref1219a re42f61a 5 5 import { MatPaginator } from '@angular/material/paginator'; 6 6 import { MatSort } from '@angular/material/sort'; 7 import { HealthcareWorkers } from '../models/HealthcareWorkers'; 7 8 8 9 @Component({ … … 13 14 export class CounterComponent implements OnInit { 14 15 public facilities: HealthFacilities[]; 16 public workers: HealthcareWorkers[]; 15 17 displayedColumns = ['Име','Општина','Адреса', 'Тип', 'Е-пошта', 'Телефон']; 18 displayedColumnsWorkers = ['Име','Гранка','Установа', 'Назив']; 16 19 dataSource = new MatTableDataSource<HealthFacilities>(); 20 dataSourceWorkers = new MatTableDataSource<HealthcareWorkers>(); 17 21 18 22 @ViewChild(MatPaginator, {static: true}) paginator: MatPaginator; … … 25 29 this.dataSource = new MatTableDataSource<HealthFacilities>(this.facilities); 26 30 }, error => console.error(error)); 31 http.get<HealthcareWorkers[]>(baseUrl + 'HealthcareWorker/Get?').subscribe(result => { 32 this.workers = result; 33 console.log(this.workers); 34 this.dataSourceWorkers = new MatTableDataSource<HealthcareWorkers>(this.workers); 35 }, error => console.error(error)); 27 36 } 28 37 ngOnInit(): void { … … 32 41 this.dataSource.paginator = this.paginator; 33 42 this.dataSource.sort = this.sort; 43 this.dataSourceWorkers.paginator = this.paginator; 44 this.dataSourceWorkers.sort = this.sort; 34 45 } 35 46 … … 38 49 filterValue = filterValue.toLowerCase(); 39 50 this.dataSource.filter = filterValue; 51 this.dataSourceWorkers.filter = filterValue; 40 52 } 41 53 } -
Farmatiko/ClientApp/src/app/dashboard/dashboard.component.ts
ref1219a re42f61a 5 5 import { MatSort } from '@angular/material/sort'; 6 6 import { HealthFacilities } from '../models/HealthFacilities'; 7 import { HttpClient } from '@angular/common/http'; ;7 import { HttpClient } from '@angular/common/http'; 8 8 import { MatDialog } from '@angular/material/dialog'; 9 9 import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar'; -
Farmatiko/ClientApp/src/environments/environment.prod.ts
ref1219a re42f61a 1 1 export const environment = { 2 production: true 2 production: true, 3 baseApiUrl: 'htpps://api.farmatiko.com/', 3 4 }; -
Farmatiko/ClientApp/src/environments/environment.ts
ref1219a re42f61a 4 4 5 5 export const environment = { 6 production: false 6 production: false, 7 baseApiUrl: 'https://localhost:44342/', 7 8 }; 8 9 -
Farmatiko/ClientApp/src/main.ts
ref1219a re42f61a 6 6 7 7 export function getBaseUrl() { 8 return document.getElementsByTagName('base')[0].href;8 return environment.baseApiUrl; 9 9 } 10 10 -
Farmatiko/ClientApp/tsconfig.json
ref1219a re42f61a 2 2 "compileOnSave": false, 3 3 "compilerOptions": { 4 "baseUrl": " ./",4 "baseUrl": "https://localhost:44342/", 5 5 "module": "esnext", 6 6 "outDir": "./dist/out-tsc", -
Farmatiko/Controllers/HealthFacilitiesController.cs
ref1219a re42f61a 1 1 using FarmatikoData; 2 2 using FarmatikoData.Models; 3 using Microsoft.AspNetCore.Cors; 3 4 using Microsoft.AspNetCore.Mvc; 4 5 using System.Collections.Generic; … … 20 21 return _healthFacilitiesService.GetAll(); 21 22 } 22 [HttpGet]23 public IEnumerable<HealthFacilities> GetByName(string Name)24 {25 return _healthFacilitiesService.GetByName(Name);26 }27 28 [HttpGet]29 public IEnumerable<HealthFacilities> GetByType(string Type)30 {31 return _healthFacilitiesService.GetByType(Type);32 }33 [HttpPut]34 public void Add(HealthFacilities healthFacility)35 {36 _healthFacilitiesService.Add(healthFacility);37 }38 23 } 39 24 } -
Farmatiko/Controllers/HealthcareWorkerController.cs
ref1219a re42f61a 1 using Microsoft.AspNetCore.Mvc; 2 using FarmatikoData.FarmatikoServiceInterfaces; 1 using System; 3 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Threading.Tasks; 4 5 using FarmatikoData.Models; 6 using FarmatikoServices.FarmatikoServiceInterfaces; 7 using Microsoft.AspNetCore.Mvc; 5 8 6 9 namespace Farmatiko.Controllers 7 10 { 11 [ApiController] 12 [Route("[controller]/[action]")] 8 13 public class HealthcareWorkerController : Controller 9 14 { … … 15 20 16 21 [HttpGet] 17 public IEnumerable<HealthcareWorkers> Get All()22 public IEnumerable<HealthcareWorkers> Get() 18 23 { 19 24 return _healthcareWorkerService.GetAll(); 20 25 } 21 [HttpGet] 22 public HealthcareWorkers GetByName(string Name) 23 { 24 return _healthcareWorkerService.GetByName(Name); 25 } 26 [HttpGet] 27 public IEnumerable<HealthcareWorkers> GetAllByBranch(string Branch) 28 { 29 return _healthcareWorkerService.GetAllByBranch(Branch); 30 } 31 [HttpGet] 32 public IEnumerable<HealthcareWorkers> GetAllByFacility(HealthFacilities Facility) 33 { 34 return _healthcareWorkerService.GetAllByFacility(Facility); 35 } 36 [HttpGet] 37 public void Add(HealthcareWorkers HealthcareWorker) 38 { 39 _healthcareWorkerService.Add(HealthcareWorker); 40 } 26 41 27 } 42 28 } -
Farmatiko/Properties/launchSettings.json
ref1219a re42f61a 1 {1 { 2 2 "iisSettings": { 3 3 "windowsAuthentication": false, … … 11 11 "IIS Express": { 12 12 "commandName": "IISExpress", 13 "launchBrowser": true,14 13 "environmentVariables": { 15 14 "ASPNETCORE_ENVIRONMENT": "Development" … … 19 18 "commandName": "Project", 20 19 "launchBrowser": true, 21 "applicationUrl": "https://localhost:5001;http://localhost:5000",22 20 "environmentVariables": { 23 21 "ASPNETCORE_ENVIRONMENT": "Development" 24 } 22 }, 23 "applicationUrl": "https://localhost:5001;http://localhost:5000" 25 24 } 26 25 } -
Farmatiko/Startup.cs
ref1219a re42f61a 11 11 using FarmatikoData.FarmatikoRepoInterfaces; 12 12 using FarmatikoData.FarmatikoRepo; 13 using FarmatikoServices.FarmatikoServiceInterfaces; 14 using FarmatikoServices.Services; 13 15 14 16 namespace Farmatiko … … 16 18 public class Startup 17 19 { 20 readonly string MyAllowSpecificOrigins = "_myAllowSpecificOrigins"; 21 18 22 public Startup(IConfiguration configuration) 19 23 { … … 26 30 public void ConfigureServices(IServiceCollection services) 27 31 { 32 services.AddCors(options => 33 { 34 options.AddPolicy(name: MyAllowSpecificOrigins, 35 builder => 36 { 37 builder.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin(); 38 }); 39 }); 40 28 41 services.AddControllersWithViews(); 29 42 // In production, the Angular files will be served from this directory … … 37 50 services.AddTransient<IHealthFacilityRepository, HealthFacilityRepository>(); 38 51 services.AddTransient<IHealthFacilityService, HealthFacilityService>(); 52 services.AddTransient<IHealthcareWorkerRepository, HealthcareWorkerRepository>(); 53 services.AddTransient<IHealthcareWorkerService, HealthcareWorkerService>(); 39 54 } 40 55 … … 62 77 app.UseRouting(); 63 78 79 app.UseCors(MyAllowSpecificOrigins); 80 64 81 app.UseEndpoints(endpoints => 65 82 { -
FarmatikoData/Base/BaseEntity.cs
ref1219a re42f61a 2 2 using System.Collections.Generic; 3 3 using System.Text; 4 using System.ComponentModel.DataAnnotations; 4 5 5 6 namespace FarmatikoData.Base … … 9 10 public int Id { get; set; } 10 11 public DateTime CreatedOn { get; set; } 11 12 public DateTime DeletedOn { get; set; } 12 public DateTime? DeletedOn { get; set; } 13 13 } 14 14 } -
FarmatikoData/FarmatikoData.csproj
ref1219a re42f61a 4 4 <TargetFramework>netcoreapp3.1</TargetFramework> 5 5 </PropertyGroup> 6 7 <ItemGroup> 8 <Compile Remove="Migrations\20200729091456_Second migration.cs" /> 9 <Compile Remove="Migrations\20200729091456_Second migration.Designer.cs" /> 10 <Compile Remove="Migrations\20200729091727_Second Migration.cs" /> 11 <Compile Remove="Migrations\20200729091727_Second Migration.Designer.cs" /> 12 <Compile Remove="Migrations\20200729101719_Third Migration.cs" /> 13 <Compile Remove="Migrations\20200729101719_Third Migration.Designer.cs" /> 14 </ItemGroup> 6 15 7 16 <ItemGroup> -
FarmatikoData/FarmatikoDataContext.cs
ref1219a re42f61a 1 1 using FarmatikoData.Models; 2 2 using Microsoft.EntityFrameworkCore; 3 using System;4 using System.Collections.Generic;5 using System.Text;6 3 7 4 namespace FarmatikoData -
FarmatikoData/FarmatikoRepo/HealthFacilityRepository.cs
ref1219a re42f61a 29 29 } 30 30 31 public IEnumerable<HealthFacilities> GetAllByName(string Name)32 {33 Name = Name.ToLower();34 35 return _context.HealthFacilities.Where(x => x.Name.ToLower().Contains(Name)).OrderBy(x => x.Name.ToLower().IndexOf(Name)).ToList();36 }37 38 IEnumerable<HealthFacilities> IHealthFacilityRepository.GetByType(string Type)39 {40 return (IEnumerable<HealthFacilities>)_context.HealthFacilities41 .Where(type => type.Type.Equals(Type));42 }43 31 } 44 32 } -
FarmatikoData/FarmatikoRepo/MedicineListRepository.cs
ref1219a re42f61a 20 20 _context.SaveChangesAsync(); 21 21 } 22 // Maybe later 23 /*public MedicineList CheckMedicine(string Name) 24 { 25 return (MedicineList)_context.MedicineLists 26 .Where(medicineList => medicineList.Medicine.Name.Contains(Name)) 27 .OrderBy(x => x.Medicine.Name); 28 }*/ 22 29 23 public MedicineList CheckMedicine(string Name)30 public ICollection<MedicineList> GetAll() 24 31 { 25 return ( MedicineList)_context.MedicineLists.Where(medicineList => medicineList.Medicine.Name.Equals(Name));32 return (ICollection<MedicineList>)_context.MedicineLists.OrderBy(x => x.Medicine.Name); 26 33 } 27 34 28 public MedicineList GetAll()35 public ICollection<MedicineList> GetByManufacturer(string Manufacturer) 29 36 { 30 return (MedicineList)_context.MedicineLists.Include(list => list.Medicine).Include(list => list.HasMedicine); 37 return (ICollection<MedicineList>)_context.MedicineLists 38 .Where(x => x.Medicine.Manufacturer.Contains(Manufacturer)) 39 .OrderBy(x => x.Medicine.Name); 40 } 41 public ICollection<MedicineList> GetByName(string Name) 42 { 43 return (ICollection<MedicineList>)_context.MedicineLists 44 .Where(x => x.Medicine.Name.Contains(Name)) 45 .OrderBy(x => x.Medicine.Name); 31 46 } 32 47 33 48 public void Remove(MedicineList medicineList) 34 49 { 35 //throw new NotImplementedException(); 36 //Implement later 50 var list = (MedicineList)_context.MedicineLists.Where(x => x.Equals(medicineList)); 51 _context.Remove(list); 52 } 53 54 public void SetHasMedicine(MedicineList medicineList, bool HasMedicine) 55 { 56 var medicine = _context.MedicineLists.Where(x => x.Medicine.Equals(medicineList.Medicine)); 37 57 } 38 58 } -
FarmatikoData/FarmatikoRepo/MedicineRepository.cs
ref1219a re42f61a 27 27 } 28 28 29 public Medicine GetByName(string Name)29 public IEnumerable<Medicine> GetByManufacturer(string Manufacturer) 30 30 { 31 return (Medicine)_context.Medicines.Where(medicine => medicine.Name == Name); 31 return _context.Medicines.Where(x => x.Name.Contains(Manufacturer)).OrderBy(x => x.Manufacturer); 32 } 33 34 public IEnumerable<Medicine> GetByName(string Name) 35 { 36 return (IEnumerable<Medicine>)_context.Medicines.Where(medicine => medicine.Name == Name); 32 37 } 33 38 … … 35 40 { 36 41 Medicine med = (Medicine)_context.Medicines.Where(medicine => medicine.Name.Equals(medicine)); 37 _context. Medicines.Remove(med);42 _context.Remove(med); 38 43 } 39 44 } -
FarmatikoData/FarmatikoRepoInterfaces/IHealthFacilityRepository.cs
ref1219a re42f61a 9 9 { 10 10 IEnumerable<HealthFacilities> GetAll(); 11 IEnumerable<HealthFacilities> GetByType(string Type);12 11 void Add(HealthFacilities healthFacility); 13 IEnumerable<HealthFacilities> GetAllByName(string Name);14 12 } 15 13 } -
FarmatikoData/FarmatikoRepoInterfaces/IHealthcareWorkerRepository.cs
ref1219a re42f61a 6 6 namespace FarmatikoData.FarmatikoRepoInterfaces 7 7 { 8 public interface IHealthcareWorker sRepository8 public interface IHealthcareWorkerRepository 9 9 { 10 10 IEnumerable<HealthcareWorkers> GetAll(); 11 HealthcareWorkers GetByName(string Name);12 ICollection<HealthcareWorkers> GetByBranch(string Branch);13 ICollection<HealthcareWorkers> GetByFacility(HealthFacilities HealthFacility);14 11 void Add(HealthcareWorkers HealthcareWorker); 15 12 void Remove(HealthcareWorkers healthcareWorker); 16 13 } 17 14 } -
FarmatikoData/FarmatikoRepoInterfaces/IMedicineListRepository.cs
ref1219a re42f61a 10 10 void Add(MedicineList medicineList); 11 11 void Remove(MedicineList medicineList); 12 MedicineList GetAll(); 13 MedicineList CheckMedicine(string Name); 12 ICollection<MedicineList> GetAll(); 13 //Not needed, maybe later 14 /*MedicineList CheckMedicine(MedicineList medicineList, bool HasMedicine); 15 public MedicineList CheckMedicine(string Name);*/ 16 ICollection<MedicineList> GetByName(string Name); 17 ICollection<MedicineList> GetByManufacturer(string Manufacturer); 18 void SetHasMedicine(MedicineList medicineList, bool HasMedicine); 14 19 } 15 20 } -
FarmatikoData/FarmatikoRepoInterfaces/IMedicineRepository.cs
ref1219a re42f61a 9 9 { 10 10 IEnumerable<Medicine> GetAll(); 11 MedicineGetByName(string Name);11 IEnumerable<Medicine> GetByName(string Name); 12 12 void Add(Medicine medicine); 13 13 void Remove(string medicine); 14 IEnumerable<Medicine> GetByManufacturer(string Manufacturer); 14 15 15 16 } -
FarmatikoData/Migrations/20200722131856_Initial migration.cs
ref1219a re42f61a 24 24 Phone = table.Column<string>(nullable: true) 25 25 }, 26 constraints: table => 26 constraints: table => 27 27 { 28 28 table.PrimaryKey("PK_HealthFacilities", x => x.Id); -
FarmatikoData/Migrations/FarmatikoDataContextModelSnapshot.cs
ref1219a re42f61a 34 34 .HasColumnType("timestamp without time zone"); 35 35 36 b.Property<DateTime >("DeletedOn")36 b.Property<DateTime?>("DeletedOn") 37 37 .HasColumnType("timestamp without time zone"); 38 38 … … 74 74 .HasColumnType("timestamp without time zone"); 75 75 76 b.Property<DateTime >("DeletedOn")76 b.Property<DateTime?>("DeletedOn") 77 77 .HasColumnType("timestamp without time zone"); 78 78 … … 104 104 .HasColumnType("timestamp without time zone"); 105 105 106 b.Property<DateTime >("DeletedOn")106 b.Property<DateTime?>("DeletedOn") 107 107 .HasColumnType("timestamp without time zone"); 108 108 … … 112 112 b.Property<string>("Manufacturer") 113 113 .HasColumnType("text"); 114 115 b.Property<int?>("MedicineListId")116 .HasColumnType("integer");117 114 118 115 b.Property<string>("Name") … … 133 130 b.HasKey("Id"); 134 131 135 b.HasIndex("MedicineListId");136 137 132 b.ToTable("Medicines"); 138 133 }); … … 148 143 .HasColumnType("timestamp without time zone"); 149 144 150 b.Property<DateTime >("DeletedOn")145 b.Property<DateTime?>("DeletedOn") 151 146 .HasColumnType("timestamp without time zone"); 152 147 … … 154 149 .HasColumnType("boolean"); 155 150 156 b.Property<int?>("Medicine sId")151 b.Property<int?>("MedicineId") 157 152 .HasColumnType("integer"); 158 153 … … 162 157 b.HasKey("Id"); 163 158 164 b.HasIndex("Medicine sId");159 b.HasIndex("MedicineId"); 165 160 166 161 b.HasIndex("PharmacyHeadId"); … … 176 171 .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); 177 172 178 b.Property< int>("ActiveGlobal")179 .HasColumnType(" integer");173 b.Property<long>("ActiveGlobal") 174 .HasColumnType("bigint"); 180 175 181 176 b.Property<int>("ActiveMK") … … 185 180 .HasColumnType("timestamp without time zone"); 186 181 187 b.Property< int>("DeathsGlobal")188 .HasColumnType(" integer");182 b.Property<long>("DeathsGlobal") 183 .HasColumnType("bigint"); 189 184 190 185 b.Property<int>("DeathsMK") 191 186 .HasColumnType("integer"); 192 187 193 b.Property<DateTime >("DeletedOn")188 b.Property<DateTime?>("DeletedOn") 194 189 .HasColumnType("timestamp without time zone"); 195 190 … … 200 195 .HasColumnType("integer"); 201 196 202 b.Property< int>("TotalGlobal")203 .HasColumnType(" integer");197 b.Property<long>("TotalGlobal") 198 .HasColumnType("bigint"); 204 199 205 200 b.Property<int>("TotalMK") … … 224 219 .HasColumnType("timestamp without time zone"); 225 220 226 b.Property<DateTime >("DeletedOn")221 b.Property<DateTime?>("DeletedOn") 227 222 .HasColumnType("timestamp without time zone"); 228 223 … … 256 251 .HasColumnType("timestamp without time zone"); 257 252 258 b.Property<DateTime >("DeletedOn")253 b.Property<DateTime?>("DeletedOn") 259 254 .HasColumnType("timestamp without time zone"); 260 255 … … 292 287 }); 293 288 294 modelBuilder.Entity("FarmatikoData.Models.Medicine", b =>295 {296 b.HasOne("FarmatikoData.Models.MedicineList", null)297 .WithMany("MedicinesList")298 .HasForeignKey("MedicineListId");299 });300 301 289 modelBuilder.Entity("FarmatikoData.Models.MedicineList", b => 302 290 { 303 b.HasOne("FarmatikoData.Models.Medicine", "Medicine s")291 b.HasOne("FarmatikoData.Models.Medicine", "Medicine") 304 292 .WithMany() 305 .HasForeignKey("Medicine sId");293 .HasForeignKey("MedicineId"); 306 294 307 295 b.HasOne("FarmatikoData.Models.PharmacyHead", null) -
FarmatikoData/Models/Medicine.cs
ref1219a re42f61a 1 using System; 2 using System.Collections.Generic; 3 using System.Text; 4 using FarmatikoData.Base; 5 using Microsoft.EntityFrameworkCore; 1 using FarmatikoData.Base; 6 2 7 3 namespace FarmatikoData.Models -
FarmatikoServices/FarmatikoServiceInterfaces/IHealthFacilityService.cs
ref1219a re42f61a 8 8 public interface IHealthFacilityService 9 9 { 10 IEnumerable<HealthFacilities> GetByName(string name);11 10 IEnumerable<HealthFacilities> GetAll(); 12 IEnumerable<HealthFacilities> GetByType(string Type);13 11 void Add(HealthFacilities healthFacility); 14 12 } -
FarmatikoServices/FarmatikoServiceInterfaces/IHealthcareWorkerService.cs
ref1219a re42f61a 1 1 using FarmatikoData.Models; 2 using System; 2 3 using System.Collections.Generic; 4 using System.Text; 3 5 4 namespace Farmatiko Data.FarmatikoServiceInterfaces6 namespace FarmatikoServices.FarmatikoServiceInterfaces 5 7 { 6 8 public interface IHealthcareWorkerService 7 9 { 8 10 IEnumerable<HealthcareWorkers> GetAll(); 9 HealthcareWorkers GetByName(string Name); 10 IEnumerable<HealthcareWorkers> GetAllByBranch(string Branch); 11 IEnumerable<HealthcareWorkers> GetAllByFacility(HealthFacilities Facility); 12 void Add(HealthcareWorkers HealthcareWorker); 11 void Add(HealthcareWorkers healthcareWorker); 12 //Not needed 13 /*void Remove(HealthcareWorkers healthcareWorker);*/ 13 14 } 14 15 } -
FarmatikoServices/Services/HealthFacilityService.cs
ref1219a re42f61a 25 25 return _healthFacilityRepository.GetAll(); 26 26 } 27 28 public IEnumerable<HealthFacilities> GetByName(string name)29 {30 return _healthFacilityRepository.GetAllByName(name);31 }32 33 public IEnumerable<HealthFacilities> GetByType(string Type)34 {35 return _healthFacilityRepository.GetByType(Type);36 }37 27 } 38 28 } -
FarmatikoServices/Services/HealthcareWorkerService.cs
ref1219a re42f61a 1 using FarmatikoData.FarmatikoRepo Interfaces;2 using FarmatikoData.Farmatiko ServiceInterfaces;1 using FarmatikoData.FarmatikoRepo; 2 using FarmatikoData.FarmatikoRepoInterfaces; 3 3 using FarmatikoData.Models; 4 using FarmatikoServices.FarmatikoServiceInterfaces; 4 5 using System; 5 6 using System.Collections.Generic; … … 10 11 public class HealthcareWorkerService : IHealthcareWorkerService 11 12 { 12 private IHealthcareWorker sRepository _workersRepository;13 public HealthcareWorkerService(IHealthcareWorker sRepository workersRepository)13 private IHealthcareWorkerRepository _healthcareWorkerRepo; 14 public HealthcareWorkerService(IHealthcareWorkerRepository healthcareWorkerRepo) 14 15 { 15 _ workersRepository = workersRepository;16 _healthcareWorkerRepo = healthcareWorkerRepo; 16 17 } 17 public void Add(HealthcareWorkers HealthcareWorker)18 public void Add(HealthcareWorkers healthcareWorker) 18 19 { 19 _ workersRepository.Add(HealthcareWorker);20 _healthcareWorkerRepo.Add(healthcareWorker); 20 21 } 21 22 22 23 public IEnumerable<HealthcareWorkers> GetAll() 23 24 { 24 return _workersRepository.GetAll(); 25 } 26 27 public IEnumerable<HealthcareWorkers> GetAllByBranch(string Branch) 28 { 29 return _workersRepository.GetByBranch(Branch); 30 } 31 32 public IEnumerable<HealthcareWorkers> GetAllByFacility(HealthFacilities Facility) 33 { 34 return _workersRepository.GetByFacility(Facility); 35 } 36 37 public HealthcareWorkers GetByName(string Name) 38 { 39 return _workersRepository.GetByName(Name); 25 return _healthcareWorkerRepo.GetAll(); 40 26 } 41 27 }
Note:
See TracChangeset
for help on using the changeset viewer.