Пример #1
0
        public IEnumerable <Labour> GetLabourPayments(int siteId)
        {
            var entities = _labourRepo.Find(x => x.SiteId == siteId);
            var mapper   = new LaboursPaymentMapper();

            return(mapper.Map(entities.ToList()));
        }
Пример #2
0
        public void AddLabourPayment(Labour labour)
        {
            var mapper = new LaboursPaymentMapper();
            var entity = mapper.Map(labour);

            _labourRepo.Add(entity);
            _labourRepo.Save();
        }
Пример #3
0
        public void DeleteLabour(Labour labour)
        {
            var mapper         = new LaboursPaymentMapper();
            var entity         = mapper.Map(labour);
            var entityToDelete = _labourRepo.Get(entity.LabourId);

            _labourRepo.Delete(entityToDelete);
            _labourRepo.Save();
        }