Changeset d2e69be
- Timestamp:
- 07/27/20 17:10:07 (4 years ago)
- Branches:
- master
- Children:
- ef1219a
- Parents:
- 4b342bb
- Files:
-
- 5 added
- 2 deleted
- 9 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/counter/counter.component.html
r4b342bb rd2e69be 17 17 </thead> 18 18 <tbody> 19 19 <tr *ngFor="let facility of facilities"> 20 20 <td>{{ facility.Name }}</td> 21 <td>{{ facility.Municipality }}</td> 22 <td>{{ facility.Address }}</td> 23 <td>{{ facility.Type }}</td> 24 <td>{{ facility.Email }}</td> 25 <td>{{ facility.Phone }}</td> 26 </tr> 21 <!-- 22 <td>{{ facility.Municipality }}</td> 23 <td>{{ facility.Address }}</td> 24 <td>{{ facility.Type }}</td> 25 <td>{{ facility.Email }}</td> 26 <td>{{ facility.Phone }}</td>--> 27 <td>facility.Municipality</td> 28 <td></td> 29 <td></td> 30 <td></td> 31 <td> 32 33 </td> 34 35 </tr> 27 36 </tbody> 28 37 </table> -
Farmatiko/ClientApp/src/app/counter/counter.component.ts
r4b342bb rd2e69be 11 11 12 12 constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string) { 13 http.get<HealthFacilities[]>(baseUrl + 'HealthFacilities ').subscribe(result => {13 http.get<HealthFacilities[]>(baseUrl + 'HealthFacilities/Get?').subscribe(result => { 14 14 this.facilities = result; 15 console.log(this.facilities); 15 16 }, error => console.error(error)); 16 } 17 } 17 18 } 19 /*interface healthFacilities { 20 Name: string; 21 Municipality: string; 22 Address: string; 23 Type: string; 24 Email: string; 25 Phone: string; 26 }*/ 27 -
Farmatiko/Farmatiko.csproj
r4b342bb rd2e69be 36 36 <ItemGroup> 37 37 <ProjectReference Include="..\FarmatikoData\FarmatikoData.csproj" /> 38 <ProjectReference Include="..\FarmatikoServices\FarmatikoServices.csproj" /> 38 39 </ItemGroup> 39 40 -
Farmatiko/Startup.cs
r4b342bb rd2e69be 8 8 using FarmatikoData; 9 9 using Microsoft.EntityFrameworkCore; 10 using FarmatikoServices; 11 using FarmatikoData.FarmatikoRepoInterfaces; 12 using FarmatikoData.FarmatikoRepo; 10 13 11 14 namespace Farmatiko … … 32 35 services.AddEntityFrameworkNpgsql().AddDbContext<FarmatikoDataContext>(opt => opt.UseNpgsql(connectionString)); 33 36 37 services.AddTransient<IHealthFacilityRepository, HealthFacilityRepository>(); 38 services.AddTransient<IHealthFacilityService, HealthFacilityService>(); 34 39 } 35 40 -
FarmatikoData/Base/BaseEntity.cs
r4b342bb rd2e69be 9 9 public int Id { get; set; } 10 10 public DateTime CreatedOn { get; set; } 11 11 12 public DateTime DeletedOn { get; set; } 12 13 } -
FarmatikoData/FarmatikoRepo/HealthFacilityRepository.cs
r4b342bb rd2e69be 26 26 public IEnumerable<HealthFacilities> GetAll() 27 27 { 28 return _context.HealthFacilities ;28 return _context.HealthFacilities.OrderBy(x => x.Name).ToList(); 29 29 } 30 30 31 public HealthFacilities GetByFullName(string FullName)31 public IEnumerable<HealthFacilities> GetAllByName(string Name) 32 32 { 33 return (HealthFacilities)_context.HealthFacilities34 .Where(Facility => Facility.Name == FullName) 35 .FirstOrDefault(Facility => Facility.Name == FullName);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 36 } 37 37 38 public HealthFacilities GetByType(string FacilityType)38 IEnumerable<HealthFacilities> IHealthFacilityRepository.GetByType(string Type) 39 39 { 40 return (HealthFacilities)_context.HealthFacilities 41 .Where(FacilityType => FacilityType.Type.Equals(FacilityType)) 42 .FirstOrDefault(FacilityType => FacilityType.Name.Equals(FacilityType)); 40 return (IEnumerable<HealthFacilities>)_context.HealthFacilities 41 .Where(type => type.Type.Equals(Type)); 43 42 } 44 45 public void Remove(string healthFacility)46 {47 HealthFacilities Facility = (HealthFacilities)_context.HealthFacilities.Where(healthFacility => healthFacility.Name.Equals(healthFacility));48 _context.Remove(Facility);49 _context.SaveChangesAsync();50 }51 52 43 } 53 44 } -
FarmatikoData/FarmatikoRepoInterfaces/IHealthFacilityRepository.cs
r4b342bb rd2e69be 9 9 { 10 10 IEnumerable<HealthFacilities> GetAll(); 11 HealthFacilities GetByFullName(string FullName); 12 HealthFacilities GetByType(string FacilityType); 11 IEnumerable<HealthFacilities> GetByType(string Type); 13 12 void Add(HealthFacilities healthFacility); 14 void Remove(string healthFacility);13 IEnumerable<HealthFacilities> GetAllByName(string Name); 15 14 } 16 15 } -
FarmatikoData/Migrations/20200722131856_Initial migration.cs
r4b342bb rd2e69be 15 15 Id = table.Column<int>(nullable: false) 16 16 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 17 CreatedOn = table.Column<DateTime>(nullable: false ),18 DeletedOn = table.Column<DateTime>(nullable: false),17 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 18 DeletedOn = table.Column<DateTime>(nullable: true), 19 19 Name = table.Column<string>(nullable: false), 20 20 Municipality = table.Column<string>(nullable: false), … … 35 35 Id = table.Column<int>(nullable: false) 36 36 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 37 CreatedOn = table.Column<DateTime>(nullable: false ),38 DeletedOn = table.Column<DateTime>(nullable: false),37 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 38 DeletedOn = table.Column<DateTime>(nullable: true), 39 39 Name = table.Column<string>(nullable: true), 40 40 TotalMK = table.Column<int>(nullable: false), … … 57 57 Id = table.Column<int>(nullable: false) 58 58 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 59 CreatedOn = table.Column<DateTime>(nullable: false ),60 DeletedOn = table.Column<DateTime>(nullable: false),59 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 60 DeletedOn = table.Column<DateTime>(nullable: true), 61 61 Name = table.Column<string>(nullable: false), 62 62 Branch = table.Column<string>(nullable: false), … … 81 81 Id = table.Column<int>(nullable: false) 82 82 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 83 CreatedOn = table.Column<DateTime>(nullable: false ),84 DeletedOn = table.Column<DateTime>(nullable: false),83 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 84 DeletedOn = table.Column<DateTime>(nullable: true), 85 85 Name = table.Column<string>(nullable: true), 86 86 Strength = table.Column<string>(nullable: true), … … 103 103 Id = table.Column<int>(nullable: false) 104 104 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 105 CreatedOn = table.Column<DateTime>(nullable: false ),106 DeletedOn = table.Column<DateTime>(nullable: false),105 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 106 DeletedOn = table.Column<DateTime>(nullable: true), 107 107 PharmacyMedicinesId = table.Column<int>(nullable: true), 108 108 PharmacyId = table.Column<int>(nullable: true), … … 122 122 Id = table.Column<int>(nullable: false) 123 123 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 124 CreatedOn = table.Column<DateTime>(nullable: false ),125 DeletedOn = table.Column<DateTime>(nullable: false),124 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 125 DeletedOn = table.Column<DateTime>(nullable: true), 126 126 MedicinesId = table.Column<int>(nullable: true), 127 127 HasMedicine = table.Column<bool>(nullable: false), … … 151 151 Id = table.Column<int>(nullable: false) 152 152 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 153 CreatedOn = table.Column<DateTime>(nullable: false ),154 DeletedOn = table.Column<DateTime>(nullable: false),153 CreatedOn = table.Column<DateTime>(nullable: false, defaultValueSql: "now()"), 154 DeletedOn = table.Column<DateTime>(nullable: true), 155 155 Name = table.Column<string>(nullable: true), 156 156 Location = table.Column<string>(nullable: true), -
FarmatikoServices/FarmatikoServiceInterfaces/IHealthcareWorkerService.cs
r4b342bb rd2e69be 1 1 using FarmatikoData.Models; 2 using System;3 2 using System.Collections.Generic; 4 using System.Text;5 3 6 4 namespace FarmatikoData.FarmatikoServiceInterfaces 7 5 { 8 public interface IHealthcareWorker sService6 public interface IHealthcareWorkerService 9 7 { 10 8 IEnumerable<HealthcareWorkers> GetAll(); … … 12 10 IEnumerable<HealthcareWorkers> GetAllByBranch(string Branch); 13 11 IEnumerable<HealthcareWorkers> GetAllByFacility(HealthFacilities Facility); 12 void Add(HealthcareWorkers HealthcareWorker); 14 13 } 15 14 } -
FarmatikoServices/FarmatikoServices.csproj
r4b342bb rd2e69be 6 6 7 7 <ItemGroup> 8 <PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> 9 </ItemGroup> 10 11 <ItemGroup> 8 12 <ProjectReference Include="..\FarmatikoData\FarmatikoData.csproj" /> 9 13 </ItemGroup>
Note:
See TracChangeset
for help on using the changeset viewer.