예제 #1
0
        public COFDTO GetByID(int ID)
        {
            COFFlammable COF = (from p in _unitOfWork.COFFlammable.FindAll().Where(p => p.ID == ID)
                                select p).FirstOrDefault();
            COFDTO inspectionStrategDTO = _mapper.Map <COFDTO>(COF);

            return(inspectionStrategDTO);
        }
예제 #2
0
        public void Create(COFDTO COFDTO)
        {
            COFFlammable COF = _mapper.Map <COFFlammable>(COFDTO);

            COF.CreatedDate = DateTime.Now;

            _unitOfWork.COFFlammable.Create(COF);
            _unitOfWork.SaveChanges();
        }
예제 #3
0
        public void Update(COFDTO COFDTO)
        {
            var response = _unitOfWork.COFFlammable.FindById(COFDTO.ID);

            if (response != null)
            {
                response.ModifiedDate = DateTime.Now;
            }
            _unitOfWork.COFFlammable.Update(response);
            _unitOfWork.SaveChanges();
        }