Changeset a55ef91 for FarmatikoServices/Services/PharmacyHeadService.cs
- Timestamp:
- 07/31/20 10:15:02 (3 years ago)
- Branches:
- master
- Children:
- d8fafb8
- Parents:
- 4e72684
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
FarmatikoServices/Services/PharmacyHeadService.cs
r4e72684 ra55ef91 3 3 using FarmatikoServices.FarmatikoServiceInterfaces; 4 4 using System; 5 using System.Collections.Generic;6 5 using System.Linq; 7 using System.Text;8 6 9 7 namespace FarmatikoServices.Services … … 19 17 public void Add(PharmacyHead pharmacyHead) 20 18 { 21 if (pharmacyHead != null)19 try 22 20 { 23 _pharmacyHeadRepository.Add(pharmacyHead); 21 if (pharmacyHead != null) 22 { 23 _pharmacyHeadRepository.Add(pharmacyHead); 24 } 24 25 } 26 catch (Exception e) 27 { 28 e = new Exception("Can't add, pharmacy head is null."); 29 } 30 25 31 } 26 32 27 33 public IQueryable<PharmacyHead> GetAllPharmacies(string NameOfPharmacyHead) 28 34 { 29 if (NameOfPharmacyHead != null)35 if (NameOfPharmacyHead != null) 30 36 { 31 37 IQueryable<PharmacyHead> Pharmacy = _pharmacyHeadRepository.GetAllPharmacies(NameOfPharmacyHead); 32 38 if (Pharmacy != null) 33 {34 39 return Pharmacy; 35 }36 40 } 37 41 return null; … … 40 44 public IQueryable<PharmacyHead> GetPharmacyByName(string Name) 41 45 { 42 if (Name != null)46 if (Name != null) 43 47 { 44 48 IQueryable<PharmacyHead> PharmacyHead = _pharmacyHeadRepository.GetPharmacyByName(Name); … … 51 55 public IQueryable<MedicineList> GetPharmacyMedicines(string NameOfPharmacy) 52 56 { 53 if (NameOfPharmacy != null)57 if (NameOfPharmacy != null) 54 58 { 55 59 IQueryable<MedicineList> Medicines = _pharmacyHeadRepository.GetPharmacyMedicines(NameOfPharmacy); … … 62 66 public void Remove(PharmacyHead pharmacyHead, string Name) 63 67 { 64 if (pharmacyHead != null && Name != null)68 try 65 69 { 66 _pharmacyHeadRepository.Remove(pharmacyHead, Name); 70 if (Name != null) 71 { 72 _pharmacyHeadRepository.Remove(pharmacyHead, Name); 73 } 67 74 } 75 catch (Exception e) 76 { 77 e = new Exception("Can't remove, name of pharmacy head is null."); 78 } 79 68 80 } 69 81 }
Note:
See TracChangeset
for help on using the changeset viewer.