Changeset e42f61a


Ignore:
Timestamp:
07/29/20 13:21:48 (4 years ago)
Author:
DimitarSlezenkovski <dslezenkovski@…>
Branches:
master
Children:
de18858
Parents:
ef1219a
Message:

Add more services

Files:
8 added
1 deleted
28 edited
1 moved

Legend:

Unmodified
Added
Removed
  • Farmatiko/ClientApp/package.json

    ref1219a re42f61a  
    44  "scripts": {
    55    "ng": "ng",
    6     "start": "ng serve -o",
     6    "start": "ng serve",
    77    "build": "ng build",
    88    "build:ssr": "ng run Farmatiko:server:dev",
  • Farmatiko/ClientApp/src/app/counter/counter.component.html

    ref1219a re42f61a  
    33
    44<mat-tab-group mat-stretch-tabs>
    5   <mat-tab class="tab" label="Здравствени установи"> 
     5  <mat-tab class="tab" label="Здравствени установи">
    66  <div class="wrapper">
    77    <div class="header">
     
    1616        <td mat-cell *matCellDef="let facilities"> {{facilities.name}} </td>
    1717      </ng-container>
    18  
     18
    1919      <ng-container matColumnDef="Општина">
    2020        <th mat-header-cell *matHeaderCellDef mat-sort-header> Општина </th>
    2121        <td mat-cell *matCellDef="let facilities"> {{facilities.municipality}} </td>
    2222      </ng-container>
    23    
     23
    2424      <ng-container matColumnDef="Адреса">
    2525        <th mat-header-cell *matHeaderCellDef mat-sort-header> Адреса </th>
    2626        <td mat-cell *matCellDef="let facilities"> {{facilities.address}} </td>
    2727      </ng-container>
    28      
     28
    2929      <ng-container matColumnDef="Тип">
    3030        <th mat-header-cell *matHeaderCellDef mat-sort-header> Тип </th>
    3131        <td mat-cell *matCellDef="let facilities"> {{facilities.type}} </td>
    3232      </ng-container>
    33  
     33
    3434      <ng-container matColumnDef="Е-пошта">
    3535        <th mat-header-cell *matHeaderCellDef mat-sort-header> Е-пошта </th>
    3636        <td mat-cell *matCellDef="let facilities"> {{facilities.email}} </td>
    3737      </ng-container>
    38    
     38
    3939      <ng-container matColumnDef="Телефон">
    4040        <th mat-header-cell *matHeaderCellDef mat-sort-header> Телефон </th>
     
    4848  </div>
    4949  </mat-tab>
    50   <mat-tab class="tab" label="Здравствени работници"> 
     50  <mat-tab class="tab" label="Здравствени работници">
    5151  <div class="wrapper">
    5252    <div class="header">
     
    5656    </mat-form-field>
    5757    </div>
    58       <table [dataSource]="dataSource" mat-table matSort class="mat-elevation-z8">
     58      <table [dataSource]="dataSourceWorkers" mat-table matSort class="mat-elevation-z8">
    5959        <ng-container matColumnDef="Име">
    6060          <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>
    6262        </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>
    6767        </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>
    7272        </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>
    7777        </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>
    9183      </table>
    9284      <mat-paginator #paginator [pageSize]="5" [pageSizeOptions]="[5, 10, 20, 100]"></mat-paginator>
  • Farmatiko/ClientApp/src/app/counter/counter.component.ts

    ref1219a re42f61a  
    55import { MatPaginator } from '@angular/material/paginator';
    66import { MatSort } from '@angular/material/sort';
     7import { HealthcareWorkers } from '../models/HealthcareWorkers';
    78
    89@Component({
     
    1314export class CounterComponent implements OnInit {
    1415  public facilities: HealthFacilities[];
     16  public workers: HealthcareWorkers[];
    1517  displayedColumns = ['Име','Општина','Адреса', 'Тип', 'Е-пошта', 'Телефон'];
     18  displayedColumnsWorkers = ['Име','Гранка','Установа', 'Назив'];
    1619  dataSource = new MatTableDataSource<HealthFacilities>();
     20  dataSourceWorkers = new MatTableDataSource<HealthcareWorkers>();
    1721
    1822  @ViewChild(MatPaginator, {static: true}) paginator: MatPaginator;
     
    2529      this.dataSource = new MatTableDataSource<HealthFacilities>(this.facilities);
    2630    }, 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));
    2736  }
    2837  ngOnInit(): void {
     
    3241    this.dataSource.paginator = this.paginator;
    3342    this.dataSource.sort = this.sort;
     43    this.dataSourceWorkers.paginator = this.paginator;
     44    this.dataSourceWorkers.sort = this.sort;
    3445  }
    3546
     
    3849    filterValue = filterValue.toLowerCase();
    3950    this.dataSource.filter = filterValue;
     51    this.dataSourceWorkers.filter = filterValue;
    4052  }
    4153}
  • Farmatiko/ClientApp/src/app/dashboard/dashboard.component.ts

    ref1219a re42f61a  
    55import { MatSort } from '@angular/material/sort';
    66import { HealthFacilities } from '../models/HealthFacilities';
    7 import { HttpClient } from '@angular/common/http';;
     7import { HttpClient } from '@angular/common/http';
    88import { MatDialog } from '@angular/material/dialog';
    99import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar';
  • Farmatiko/ClientApp/src/environments/environment.prod.ts

    ref1219a re42f61a  
    11export const environment = {
    2   production: true
     2  production: true,
     3  baseApiUrl: 'htpps://api.farmatiko.com/',
    34};
  • Farmatiko/ClientApp/src/environments/environment.ts

    ref1219a re42f61a  
    44
    55export const environment = {
    6   production: false
     6  production: false,
     7  baseApiUrl: 'https://localhost:44342/',
    78};
    89
  • Farmatiko/ClientApp/src/main.ts

    ref1219a re42f61a  
    66
    77export function getBaseUrl() {
    8   return document.getElementsByTagName('base')[0].href;
     8  return environment.baseApiUrl;
    99}
    1010
  • Farmatiko/ClientApp/tsconfig.json

    ref1219a re42f61a  
    22  "compileOnSave": false,
    33  "compilerOptions": {
    4     "baseUrl": "./",
     4    "baseUrl": "https://localhost:44342/",
    55    "module": "esnext",
    66    "outDir": "./dist/out-tsc",
  • Farmatiko/Controllers/HealthFacilitiesController.cs

    ref1219a re42f61a  
    11using FarmatikoData;
    22using FarmatikoData.Models;
     3using Microsoft.AspNetCore.Cors;
    34using Microsoft.AspNetCore.Mvc;
    45using System.Collections.Generic;
     
    2021            return _healthFacilitiesService.GetAll();
    2122        }
    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         }
    3823    }
    3924}
  • Farmatiko/Controllers/HealthcareWorkerController.cs

    ref1219a re42f61a  
    1 using Microsoft.AspNetCore.Mvc;
    2 using FarmatikoData.FarmatikoServiceInterfaces;
     1using System;
    32using System.Collections.Generic;
     3using System.Linq;
     4using System.Threading.Tasks;
    45using FarmatikoData.Models;
     6using FarmatikoServices.FarmatikoServiceInterfaces;
     7using Microsoft.AspNetCore.Mvc;
    58
    69namespace Farmatiko.Controllers
    710{
     11    [ApiController]
     12    [Route("[controller]/[action]")]
    813    public class HealthcareWorkerController : Controller
    914    {
     
    1520
    1621        [HttpGet]
    17         public IEnumerable<HealthcareWorkers> GetAll()
     22        public IEnumerable<HealthcareWorkers> Get()
    1823        {
    1924            return _healthcareWorkerService.GetAll();
    2025        }
    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
    4127    }
    4228}
  • Farmatiko/Properties/launchSettings.json

    ref1219a re42f61a  
    1 {
     1{
    22  "iisSettings": {
    33    "windowsAuthentication": false,
     
    1111    "IIS Express": {
    1212      "commandName": "IISExpress",
    13       "launchBrowser": true,
    1413      "environmentVariables": {
    1514        "ASPNETCORE_ENVIRONMENT": "Development"
     
    1918      "commandName": "Project",
    2019      "launchBrowser": true,
    21       "applicationUrl": "https://localhost:5001;http://localhost:5000",
    2220      "environmentVariables": {
    2321        "ASPNETCORE_ENVIRONMENT": "Development"
    24       }
     22      },
     23      "applicationUrl": "https://localhost:5001;http://localhost:5000"
    2524    }
    2625  }
  • Farmatiko/Startup.cs

    ref1219a re42f61a  
    1111using FarmatikoData.FarmatikoRepoInterfaces;
    1212using FarmatikoData.FarmatikoRepo;
     13using FarmatikoServices.FarmatikoServiceInterfaces;
     14using FarmatikoServices.Services;
    1315
    1416namespace Farmatiko
     
    1618    public class Startup
    1719    {
     20        readonly string MyAllowSpecificOrigins = "_myAllowSpecificOrigins";
     21
    1822        public Startup(IConfiguration configuration)
    1923        {
     
    2630        public void ConfigureServices(IServiceCollection services)
    2731        {
     32            services.AddCors(options =>
     33            {
     34                options.AddPolicy(name: MyAllowSpecificOrigins,
     35                                  builder =>
     36                                  {
     37                                      builder.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin();
     38                                  });
     39            });
     40
    2841            services.AddControllersWithViews();
    2942            // In production, the Angular files will be served from this directory
     
    3750            services.AddTransient<IHealthFacilityRepository, HealthFacilityRepository>();
    3851            services.AddTransient<IHealthFacilityService, HealthFacilityService>();
     52            services.AddTransient<IHealthcareWorkerRepository, HealthcareWorkerRepository>();
     53            services.AddTransient<IHealthcareWorkerService, HealthcareWorkerService>();
    3954        }
    4055
     
    6277            app.UseRouting();
    6378
     79            app.UseCors(MyAllowSpecificOrigins);
     80
    6481            app.UseEndpoints(endpoints =>
    6582            {
  • FarmatikoData/Base/BaseEntity.cs

    ref1219a re42f61a  
    22using System.Collections.Generic;
    33using System.Text;
     4using System.ComponentModel.DataAnnotations;
    45
    56namespace FarmatikoData.Base
     
    910        public int Id { get; set; }
    1011        public DateTime CreatedOn { get; set; }
    11 
    12         public DateTime DeletedOn { get; set; }
     12        public DateTime? DeletedOn { get; set; }
    1313    }
    1414}
  • FarmatikoData/FarmatikoData.csproj

    ref1219a re42f61a  
    44    <TargetFramework>netcoreapp3.1</TargetFramework>
    55  </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>
    615
    716  <ItemGroup>
  • FarmatikoData/FarmatikoDataContext.cs

    ref1219a re42f61a  
    11using FarmatikoData.Models;
    22using Microsoft.EntityFrameworkCore;
    3 using System;
    4 using System.Collections.Generic;
    5 using System.Text;
    63
    74namespace FarmatikoData
  • FarmatikoData/FarmatikoRepo/HealthFacilityRepository.cs

    ref1219a re42f61a  
    2929        }
    3030
    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.HealthFacilities
    41                .Where(type => type.Type.Equals(Type));
    42         }
    4331    }
    4432}
  • FarmatikoData/FarmatikoRepo/MedicineListRepository.cs

    ref1219a re42f61a  
    2020            _context.SaveChangesAsync();
    2121        }
     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        }*/
    2229
    23         public MedicineList CheckMedicine(string Name)
     30        public ICollection<MedicineList> GetAll()
    2431        {
    25             return (MedicineList)_context.MedicineLists.Where(medicineList => medicineList.Medicine.Name.Equals(Name));
     32            return (ICollection<MedicineList>)_context.MedicineLists.OrderBy(x => x.Medicine.Name);
    2633        }
    2734
    28         public MedicineList GetAll()
     35        public ICollection<MedicineList> GetByManufacturer(string Manufacturer)
    2936        {
    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);
    3146        }
    3247
    3348        public void Remove(MedicineList medicineList)
    3449        {
    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));
    3757        }
    3858    }
  • FarmatikoData/FarmatikoRepo/MedicineRepository.cs

    ref1219a re42f61a  
    2727        }
    2828
    29         public Medicine GetByName(string Name)
     29        public IEnumerable<Medicine> GetByManufacturer(string Manufacturer)
    3030        {
    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);
    3237        }
    3338
     
    3540        {
    3641            Medicine med = (Medicine)_context.Medicines.Where(medicine => medicine.Name.Equals(medicine));
    37             _context.Medicines.Remove(med);
     42            _context.Remove(med);
    3843        }
    3944    }
  • FarmatikoData/FarmatikoRepoInterfaces/IHealthFacilityRepository.cs

    ref1219a re42f61a  
    99    {
    1010        IEnumerable<HealthFacilities> GetAll();
    11         IEnumerable<HealthFacilities> GetByType(string Type);
    1211        void Add(HealthFacilities healthFacility);
    13         IEnumerable<HealthFacilities> GetAllByName(string Name);
    1412    }
    1513}
  • FarmatikoData/FarmatikoRepoInterfaces/IHealthcareWorkerRepository.cs

    ref1219a re42f61a  
    66namespace FarmatikoData.FarmatikoRepoInterfaces
    77{
    8     public interface IHealthcareWorkersRepository
     8    public interface IHealthcareWorkerRepository
    99    {
    1010        IEnumerable<HealthcareWorkers> GetAll();
    11         HealthcareWorkers GetByName(string Name);
    12         ICollection<HealthcareWorkers> GetByBranch(string Branch);
    13         ICollection<HealthcareWorkers> GetByFacility(HealthFacilities HealthFacility);
    1411        void Add(HealthcareWorkers HealthcareWorker);
    15 
     12        void Remove(HealthcareWorkers healthcareWorker);
    1613    }
    1714}
  • FarmatikoData/FarmatikoRepoInterfaces/IMedicineListRepository.cs

    ref1219a re42f61a  
    1010        void Add(MedicineList medicineList);
    1111        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);
    1419    }
    1520}
  • FarmatikoData/FarmatikoRepoInterfaces/IMedicineRepository.cs

    ref1219a re42f61a  
    99    {
    1010        IEnumerable<Medicine> GetAll();
    11         Medicine GetByName(string Name);
     11        IEnumerable<Medicine> GetByName(string Name);
    1212        void Add(Medicine medicine);
    1313        void Remove(string medicine);
     14        IEnumerable<Medicine> GetByManufacturer(string Manufacturer);
    1415
    1516    }
  • FarmatikoData/Migrations/20200722131856_Initial migration.cs

    ref1219a re42f61a  
    2424                    Phone = table.Column<string>(nullable: true)
    2525                },
    26                 constraints: table =>
     26                constraints: table => 
    2727                {
    2828                    table.PrimaryKey("PK_HealthFacilities", x => x.Id);
  • FarmatikoData/Migrations/FarmatikoDataContextModelSnapshot.cs

    ref1219a re42f61a  
    3434                        .HasColumnType("timestamp without time zone");
    3535
    36                     b.Property<DateTime>("DeletedOn")
     36                    b.Property<DateTime?>("DeletedOn")
    3737                        .HasColumnType("timestamp without time zone");
    3838
     
    7474                        .HasColumnType("timestamp without time zone");
    7575
    76                     b.Property<DateTime>("DeletedOn")
     76                    b.Property<DateTime?>("DeletedOn")
    7777                        .HasColumnType("timestamp without time zone");
    7878
     
    104104                        .HasColumnType("timestamp without time zone");
    105105
    106                     b.Property<DateTime>("DeletedOn")
     106                    b.Property<DateTime?>("DeletedOn")
    107107                        .HasColumnType("timestamp without time zone");
    108108
     
    112112                    b.Property<string>("Manufacturer")
    113113                        .HasColumnType("text");
    114 
    115                     b.Property<int?>("MedicineListId")
    116                         .HasColumnType("integer");
    117114
    118115                    b.Property<string>("Name")
     
    133130                    b.HasKey("Id");
    134131
    135                     b.HasIndex("MedicineListId");
    136 
    137132                    b.ToTable("Medicines");
    138133                });
     
    148143                        .HasColumnType("timestamp without time zone");
    149144
    150                     b.Property<DateTime>("DeletedOn")
     145                    b.Property<DateTime?>("DeletedOn")
    151146                        .HasColumnType("timestamp without time zone");
    152147
     
    154149                        .HasColumnType("boolean");
    155150
    156                     b.Property<int?>("MedicinesId")
     151                    b.Property<int?>("MedicineId")
    157152                        .HasColumnType("integer");
    158153
     
    162157                    b.HasKey("Id");
    163158
    164                     b.HasIndex("MedicinesId");
     159                    b.HasIndex("MedicineId");
    165160
    166161                    b.HasIndex("PharmacyHeadId");
     
    176171                        .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
    177172
    178                     b.Property<int>("ActiveGlobal")
    179                         .HasColumnType("integer");
     173                    b.Property<long>("ActiveGlobal")
     174                        .HasColumnType("bigint");
    180175
    181176                    b.Property<int>("ActiveMK")
     
    185180                        .HasColumnType("timestamp without time zone");
    186181
    187                     b.Property<int>("DeathsGlobal")
    188                         .HasColumnType("integer");
     182                    b.Property<long>("DeathsGlobal")
     183                        .HasColumnType("bigint");
    189184
    190185                    b.Property<int>("DeathsMK")
    191186                        .HasColumnType("integer");
    192187
    193                     b.Property<DateTime>("DeletedOn")
     188                    b.Property<DateTime?>("DeletedOn")
    194189                        .HasColumnType("timestamp without time zone");
    195190
     
    200195                        .HasColumnType("integer");
    201196
    202                     b.Property<int>("TotalGlobal")
    203                         .HasColumnType("integer");
     197                    b.Property<long>("TotalGlobal")
     198                        .HasColumnType("bigint");
    204199
    205200                    b.Property<int>("TotalMK")
     
    224219                        .HasColumnType("timestamp without time zone");
    225220
    226                     b.Property<DateTime>("DeletedOn")
     221                    b.Property<DateTime?>("DeletedOn")
    227222                        .HasColumnType("timestamp without time zone");
    228223
     
    256251                        .HasColumnType("timestamp without time zone");
    257252
    258                     b.Property<DateTime>("DeletedOn")
     253                    b.Property<DateTime?>("DeletedOn")
    259254                        .HasColumnType("timestamp without time zone");
    260255
     
    292287                });
    293288
    294             modelBuilder.Entity("FarmatikoData.Models.Medicine", b =>
    295                 {
    296                     b.HasOne("FarmatikoData.Models.MedicineList", null)
    297                         .WithMany("MedicinesList")
    298                         .HasForeignKey("MedicineListId");
    299                 });
    300 
    301289            modelBuilder.Entity("FarmatikoData.Models.MedicineList", b =>
    302290                {
    303                     b.HasOne("FarmatikoData.Models.Medicine", "Medicines")
     291                    b.HasOne("FarmatikoData.Models.Medicine", "Medicine")
    304292                        .WithMany()
    305                         .HasForeignKey("MedicinesId");
     293                        .HasForeignKey("MedicineId");
    306294
    307295                    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;
     1using FarmatikoData.Base;
    62
    73namespace FarmatikoData.Models
  • FarmatikoServices/FarmatikoServiceInterfaces/IHealthFacilityService.cs

    ref1219a re42f61a  
    88    public interface IHealthFacilityService
    99    {
    10         IEnumerable<HealthFacilities> GetByName(string name);
    1110        IEnumerable<HealthFacilities> GetAll();
    12         IEnumerable<HealthFacilities> GetByType(string Type);
    1311        void Add(HealthFacilities healthFacility);
    1412    }
  • FarmatikoServices/FarmatikoServiceInterfaces/IHealthcareWorkerService.cs

    ref1219a re42f61a  
    11using FarmatikoData.Models;
     2using System;
    23using System.Collections.Generic;
     4using System.Text;
    35
    4 namespace FarmatikoData.FarmatikoServiceInterfaces
     6namespace FarmatikoServices.FarmatikoServiceInterfaces
    57{
    68    public interface IHealthcareWorkerService
    79    {
    810        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);*/
    1314    }
    1415}
  • FarmatikoServices/Services/HealthFacilityService.cs

    ref1219a re42f61a  
    2525            return _healthFacilityRepository.GetAll();
    2626        }
    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         }
    3727    }
    3828}
  • FarmatikoServices/Services/HealthcareWorkerService.cs

    ref1219a re42f61a  
    1 using FarmatikoData.FarmatikoRepoInterfaces;
    2 using FarmatikoData.FarmatikoServiceInterfaces;
     1using FarmatikoData.FarmatikoRepo;
     2using FarmatikoData.FarmatikoRepoInterfaces;
    33using FarmatikoData.Models;
     4using FarmatikoServices.FarmatikoServiceInterfaces;
    45using System;
    56using System.Collections.Generic;
     
    1011    public class HealthcareWorkerService : IHealthcareWorkerService
    1112    {
    12         private IHealthcareWorkersRepository _workersRepository;
    13         public HealthcareWorkerService(IHealthcareWorkersRepository workersRepository)
     13        private IHealthcareWorkerRepository _healthcareWorkerRepo;
     14        public HealthcareWorkerService(IHealthcareWorkerRepository healthcareWorkerRepo)
    1415        {
    15             _workersRepository = workersRepository;
     16            _healthcareWorkerRepo = healthcareWorkerRepo;
    1617        }
    17         public void Add(HealthcareWorkers HealthcareWorker)
     18        public void Add(HealthcareWorkers healthcareWorker)
    1819        {
    19             _workersRepository.Add(HealthcareWorker);
     20            _healthcareWorkerRepo.Add(healthcareWorker);
    2021        }
    2122
    2223        public IEnumerable<HealthcareWorkers> GetAll()
    2324        {
    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();
    4026        }
    4127    }
Note: See TracChangeset for help on using the changeset viewer.