Ignore:
Timestamp:
11/05/20 06:57:35 (2 years ago)
Author:
DimitarSlezenkovski <dslezenkovski@…>
Branches:
master
Children:
afc9a9a
Parents:
1f4846d
Message:

Add SystemService, Auth, fix a lil bugs :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • FarmatikoServices/Services/Service.cs

    r1f4846d rd23bf72  
    103103            if (healthFacilities != null)
    104104                await _repository.AddFacility(healthFacilities);
    105             throw new Exception("Facility is null");
     105            else throw new Exception("Facility is null");
    106106        }
    107107        //za json(Sys updateer)
     
    110110            if (medicine != null)
    111111                await _repository.AddMedicines(medicine);
    112             throw new Exception("Medicine is null");
     112            else throw new Exception("Medicine is null");
    113113        }
    114114        //za json(Sys updateer)
     
    117117            if (pandemic != null)
    118118                await _repository.AddPandemic(pandemic);
    119             throw new Exception("Pandemic is null");
     119            else throw new Exception("Pandemic is null");
    120120        }
    121121        // Samo PharmacyHead i Admin imaat pristap
     
    124124            if (pharmacy != null)
    125125                await _repository.AddPharmacy(pharmacy);
    126             throw new Exception("Pharmacy is null");
     126            else throw new Exception("Pharmacy is null");
    127127        }
    128128        // Ovaa kontrola ja ima samo admin
     
    150150            if (worker != null)
    151151                await _repository.AddWorker(worker);
    152             throw new Exception("Worker is null");
     152            else throw new Exception("Worker is null");
    153153        }
    154154
     
    158158            if (healthFacilities != null)
    159159                await _repository.UpdateFacility(healthFacilities);
    160             throw new Exception("Facility is null");
     160            else throw new Exception("Facility is null");
    161161        }
    162162        //PharmacyHead
     
    165165            if (medicine != null)
    166166                await _repository.RemoveMedicine(medicine);
    167             throw new Exception("Medicine is null");
     167            else throw new Exception("Medicine is null");
    168168        }
    169169        //PharmacyHead
     
    172172            if (medicine != null)
    173173                await _repository.UpdateMedicine(medicine);
    174             throw new Exception("Medicine is null");
     174            else throw new Exception("Medicine is null");
    175175        }
    176176        //za json(Sys updateer)
     
    179179            if (pandemic != null)
    180180                await _repository.UpdatePandemic(pandemic);
    181             throw new Exception("Pandemic is null");
     181            else throw new Exception("Pandemic is null");
    182182        }
    183183        //PharmacyHead
     
    186186            if (pharmacy != null)
    187187                await _repository.RemovePharmacy(pharmacy);
    188             throw new Exception("Pharmacy is null");
     188            else throw new Exception("Pharmacy is null");
    189189        }
    190190        //PharamcyHead
     
    193193            if (pharmacy != null)
    194194                await _repository.UpadatePharmacy(pharmacy);
    195             throw new Exception("Pharmacy is null");
     195            else throw new Exception("Pharmacy is null");
    196196        }
    197197        //za json(Sys updateer)
     
    200200            if (worker != null)
    201201                await _repository.UpdateWorker(worker);
    202             throw new Exception("Worker is null");
     202            else throw new Exception("Worker is null");
    203203        }
    204204
     
    209209                await _repository.RemovePharmacyHead(Id);
    210210            }
    211             throw new Exception("Index out of bounds.");
    212         }
    213 
    214         public async Task<HealthFacility> GetFacilityJSON(string healthFacility)
     211            else throw new Exception("Index out of bounds.");
     212        }
     213
     214        public HealthFacility GetFacilityJSON(string healthFacility)
    215215        {
    216216            if (healthFacility != null)
    217                 return await _repository.GetFacilityJSON(healthFacility);
     217                return _repository.GetFacilityJSON(healthFacility);
    218218            return null;
    219219        }
Note: See TracChangeset for help on using the changeset viewer.