Changeset 4e72684 for FarmatikoServices


Ignore:
Timestamp:
07/29/20 20:02:58 (4 years ago)
Author:
DimitarSlezenkovski <dslezenkovski@…>
Branches:
master
Children:
a55ef91
Parents:
de18858
Message:

Add services

Location:
FarmatikoServices
Files:
6 added
2 edited

Legend:

Unmodified
Added
Removed
  • FarmatikoServices/FarmatikoServiceInterfaces/IMedicineListService.cs

    rde18858 r4e72684  
    11using FarmatikoData.Models;
    2 using System;
    32using System.Collections.Generic;
    4 using System.Text;
    53
    64namespace FarmatikoServices.FarmatikoServiceInterfaces
     
    86    public interface IMedicineListService
    97    {
    10         ICollection<MedicineList> GetAll();
    11         void SetHasMedicine(MedicineList medicineList, bool HasMedicine);
     8        IEnumerable<MedicineList> GetAll();
     9        bool SetHasMedicine(MedicineList medicineList, bool HasMedicine);
    1210        ICollection<MedicineList> GetByName(string Name);
    1311        ICollection<MedicineList> GetByManufacturer(string Manufacturer);
  • FarmatikoServices/Services/MedicineListService.cs

    rde18858 r4e72684  
    22using FarmatikoData.Models;
    33using FarmatikoServices.FarmatikoServiceInterfaces;
    4 using System;
    54using System.Collections.Generic;
    6 using System.Text;
    75
    86namespace FarmatikoServices.Services
     
    1614        }
    1715
    18         public ICollection<MedicineList> GetAll()
     16        public IEnumerable<MedicineList> GetAll()
    1917        {
    2018            return _medicineListRepository.GetAll();
     
    2826        public ICollection<MedicineList> GetByName(string Name)
    2927        {
    30             return _medicineListRepository.GetByName(Name);
     28            if(Name != null)
     29            {
     30                return _medicineListRepository.GetByName(Name);
     31            }
     32            return null;
    3133        }
    3234
    33         public void SetHasMedicine(MedicineList medicineList, bool HasMedicine)
     35        public bool SetHasMedicine(MedicineList medicineList, bool HasMedicine)
    3436        {
    35             throw new NotImplementedException();
     37            if (medicineList != null)
     38            {
     39                _medicineListRepository.SetHasMedicine(medicineList, HasMedicine);
     40                return true;
     41            }
     42            else return false;
    3643        }
    3744    }
Note: See TracChangeset for help on using the changeset viewer.