public void AddALaboratory(LaboratoryModel laboratory)
 {
     if (labRepo.GetByDate(laboratory.Date) != null || labRepo.GetByNumber(laboratory.Number) != null)
     {
         throw new Exception("laboratory already exists");
     }
     laboratory.Id = 0;
     labRepo.Add(Mapper.Map <LaboratoryDto>(laboratory));
     labRepo.Save();
 }
Beispiel #2
0
 public void AddLaboratory(LaboratoryModel laboratoryModel)
 {
     _iLaboratoryRepository.Add(_iLaboratoryMapper.Map(laboratoryModel));
     _iLaboratoryRepository.SaveChanges();
 }
Beispiel #3
0
        //public AttendanceService()
        //{
        //    attendanceRepository = new AttendanceRepository();
        //}

        public void Add(LaboratoryModel laboratoryModel)
        {
            var newLaboratory = mapper.map(laboratoryModel);

            laboratoryRepository.Add(newLaboratory);
        }