Changeset e42f61a for FarmatikoData/FarmatikoRepo
- Timestamp:
- 07/29/20 13:21:48 (4 years ago)
- Branches:
- master
- Children:
- de18858
- Parents:
- ef1219a
- Location:
- FarmatikoData/FarmatikoRepo
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.