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

            return(inspectionStrategDTO);
        }
예제 #2
0
        public void Create(InspectionStrategyDTO InspectionStrategyDTO)
        {
            InspectionStrategy inspectionStrategy = _mapper.Map <InspectionStrategy>(InspectionStrategyDTO);

            inspectionStrategy.CreatedDate = DateTime.Now;

            _unitOfWork.InspectionStrategy.Create(inspectionStrategy);
            _unitOfWork.SaveChanges();
        }
예제 #3
0
        public void Update(InspectionStrategyDTO InspectionStrategyDTO)
        {
            var response = _unitOfWork.InspectionStrategy.FindById(InspectionStrategyDTO.ID);

            if (response != null)
            {
                response.DMCode       = InspectionStrategyDTO.DMCode;
                response.Frequency    = InspectionStrategyDTO.Frequency;
                response.Priority     = InspectionStrategyDTO.Priority;
                response.NDTMethod    = InspectionStrategyDTO.NDTMethod;
                response.CreatedBy    = InspectionStrategyDTO.CreatedBy;
                response.CreatedDate  = InspectionStrategyDTO.CreatedDate;
                response.ModifiedBy   = InspectionStrategyDTO.ModifiedBy;
                response.ModifiedDate = DateTime.Now;
            }
            _unitOfWork.InspectionStrategy.Update(response);
            _unitOfWork.SaveChanges();
        }
 public void Put([FromBody] InspectionStrategyDTO comanyDTO)
 {
     _InspectionStrategyService.Update(comanyDTO);
 }
 public void Post([FromBody] InspectionStrategyDTO comanyDTO)
 {
     _InspectionStrategyService.Create(comanyDTO);
 }