Example #1
0
        public async Task <bool> Update(AuditTypeDto model)
        {
            var auditType = _mapper.Map <MES_Audit_Type_M>(model);

            auditType.Updated_Time = DateTime.Now;
            _repoAuditType.Update(auditType);
            return(await _repoAuditType.SaveAll());
        }
        public AuditTypeOutput Execute(AuditType auditType)
        {
            var at = _auditTypeRepository.CheckDuplicated(auditType);

            if (at == null)
            {
                return(_mapper.Map <AuditType, AuditTypeOutput>(_auditTypeRepository.Update(auditType)));
            }
            else
            {
                throw new DuplicateEntityException(auditType.Code, "Ya existe un tipo de auditoria con este código y/o nombre");
            }
        }