Changeset 68454c6 for FarmatikoData
- Timestamp:
- 11/15/20 19:08:48 (4 years ago)
- Branches:
- master
- Children:
- 8b13eb2
- Parents:
- 1db5673
- Location:
- FarmatikoData
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
FarmatikoData/FarmatikoDataContext.cs
r1db5673 r68454c6 27 27 .ToTable("Medicines"); 28 28 29 modelBuilder.Entity<Pharmacy>() 30 .ToTable("Pharmacies"); 31 29 32 modelBuilder.Entity<PharmacyHeadMedicine>() 30 33 .HasKey(phm => new { phm.PheadId, phm.MedicineId }); … … 44 47 .HasForeignKey(k => k.PheadId); 45 48 49 /* 50 modelBuilder.Entity<CarDetails>() 51 .ToTable("CarDetails"); 52 53 modelBuilder.Entity<CarDetails>() 54 .Property(x => x.Type) 55 .HasConversion<int>(); 56 57 modelBuilder.Entity<CarDetails>() 58 .HasMany(x => x.ImageUrls) 59 .WithOne(y => y.Car) 60 .HasForeignKey(y => y.CarId); 61 */ 62 63 /*modelBuilder.Entity<PharmacyHead>() 64 .HasMany(x => x.PharmaciesList);*/ 65 46 66 base.OnModelCreating(modelBuilder); 47 67 } -
FarmatikoData/FarmatikoRepo/PHRepo.cs
r1db5673 r68454c6 119 119 return pharms; 120 120 } 121 122 public void DeletePHMedicine(int id, int phId, int medId) 123 { 124 var PH = _context.PharmacyHeadMedicines.Where(x => x.PheadId == phId).Single(); 125 var PHMed = _context.PharmacyHeadMedicines.Where(x => x.MedicineId == medId).Single(); 126 var PHID = _context.PharmacyHeadMedicines.Where(x => x.Id == id).Single(); 127 _context.PharmacyHeadMedicines.Remove(PHID); 128 _context.SaveChanges(); 129 } 121 130 } 122 131 } -
FarmatikoData/FarmatikoRepo/Repository.cs
r1db5673 r68454c6 259 259 260 260 }).ToList(); 261 return Medicines; 261 return Medicines; 262 262 } 263 263 -
FarmatikoData/FarmatikoRepoInterfaces/IPHRepo.cs
r1db5673 r68454c6 22 22 PharmacyHead GetPharmacyHead(string head); 23 23 List<Pharmacy> GetPharmacies(); 24 void DeletePHMedicine(int id, int phId, int medId); 24 25 } 25 26 } -
FarmatikoData/Models/Pharmacy.cs
r1db5673 r68454c6 27 27 } 28 28 public int PheadId { get; set; } 29 public PharmacyHead PHead { get; set; }29 public PharmacyHead PHead { get; internal set; } 30 30 } 31 31 } -
FarmatikoData/Models/PharmacyHead.cs
r1db5673 r68454c6 21 21 [JsonProperty("Passwd")] 22 22 public string Password { get; set; } 23 24 23 25 [JsonProperty("PharmacyMedicines")] 24 26 public List<Medicine> MedicineList { get; set; } 25 [Required]26 27 [JsonProperty("Pharmacy")] 27 28 public ICollection<Pharmacy> PharmaciesList { get; set; }
Note:
See TracChangeset
for help on using the changeset viewer.