Changeset 5d02859 for FarmatikoData


Ignore:
Timestamp:
09/30/20 10:37:22 (4 years ago)
Author:
DimitarSlezenkovski <dslezenkovski@…>
Branches:
master
Children:
1454207
Parents:
63d885e
Message:

Add new repo, service and controller

Location:
FarmatikoData
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • FarmatikoData/FarmatikoDataContext.cs

    r63d885e r5d02859  
    99       
    1010
    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; }
    1515        public virtual DbSet<Pandemic> Pandemics { get; set; }
    1616        public virtual DbSet<Medicine> Medicines { get; set; }
  • FarmatikoData/Models/Medicine.cs

    r63d885e r5d02859  
    11using FarmatikoData.Base;
     2using System.ComponentModel.DataAnnotations;
    23
    34namespace FarmatikoData.Models
     
    67    {
    78        public Medicine() { }
     9        [Required]
    810        public string Name { get; set; }
     11        [Required]
    912        public string Strength { get; set; }
    1013        public string Form { get; set; }
     14        [Required]
    1115        public string WayOfIssuing { get; set; }
     16        [Required]
    1217        public string Manufacturer { get; set; }
    1318        public float Price { get; set; }
  • FarmatikoData/Models/MedicineList.cs

    r63d885e r5d02859  
    11using System.Collections.Generic;
     2using System.ComponentModel.DataAnnotations;
    23using FarmatikoData.Base;
    34using FarmatikoData.Models;
     
    1112        {
    1213        }
     14        [Required]
    1315        public Medicine Medicine { get; set; }
     16        [Required]
    1417        public bool HasMedicine { get; set; }
    1518        public MedicineList(Medicine Medicine, bool HasMedicine)
  • FarmatikoData/Models/Pandemic.cs

    r63d885e r5d02859  
    11using System;
    22using System.Collections.Generic;
     3using System.ComponentModel.DataAnnotations;
    34using System.Text;
    45using FarmatikoData.Base;
     
    1011    {
    1112        public Pandemic() { }
     13        [Required]
    1214        public string Name { get; set; }
     15        [Required]
    1316        public int TotalMK { get; set; }
     17        [Required]
    1418        public int ActiveMK { get; set; }
     19        [Required]
    1520        public int DeathsMK { get; set; }
     21        [Required]
    1622        public int NewMK { get; set; }
     23        [Required]
    1724        public long TotalGlobal { get; set; }
     25        [Required]
    1826        public long DeathsGlobal { get; set; }
     27        [Required]
    1928        public long ActiveGlobal { get; set; }
    2029        public Pandemic(string Name, int TotalMK, int ActiveMK,
  • FarmatikoData/Models/Pharmacy.cs

    r63d885e r5d02859  
    11using System;
    22using System.Collections.Generic;
     3using System.ComponentModel.DataAnnotations;
    34using System.Text;
    45using FarmatikoData.Base;
     
    1011    {
    1112        public Pharmacy() { }
     13        [Required]
    1214        public string Name { get; set; }
     15        [Required]
    1316        public string Location { get; set; }
     17        [Required]
    1418        public string Address { get; set; }
     19        [Required]
    1520        public bool WorkAllTime { get; set; }
    1621        public Pharmacy(string Name, string Location, string Address, bool WorkAllTime)
  • FarmatikoData/Models/PharmacyHead.cs

    r63d885e r5d02859  
    11using System;
    22using System.Collections.Generic;
     3using System.ComponentModel.DataAnnotations;
    34using System.Text;
    45using FarmatikoData.Base;
     
    910    public class PharmacyHead : BaseEntity
    1011    {
    11         public MedicineList PharmacyMedicines { get; set; }
    12         public Pharmacy Pharmacy { get; set; }
     12        public PharmacyHead()
     13        {
     14        }
     15        [Required]
    1316        public string Email { get; set; }
     17        [Required]
    1418        public string Name { get; set; }
     19        [Required]
    1520        public string Password { get; set; }
    1621        public ICollection<MedicineList> MedicineLists { get; set; }
    1722        public ICollection<Pharmacy> PharmaciesList { get; set; }
    18         public PharmacyHead()
    19         {
    20             PharmaciesList = new HashSet<Pharmacy>();
    21             MedicineLists = new HashSet<MedicineList>();
    22         }
     23
    2324    }
    2425}
Note: See TracChangeset for help on using the changeset viewer.