public void copy(EmailSetup email_Setup, EmailSetupDto emailSetupDto) { email_Setup.email_setup_id = emailSetupDto.email_setup_id; email_Setup.port = emailSetupDto.port; email_Setup.host = emailSetupDto.host; email_Setup.email = emailSetupDto.email; email_Setup.password = emailSetupDto.password; }
public void update(EmailSetupDto emailSetupDto) { try { using (TransactionScope txe = new TransactionScope(TransactionScopeOption.Required)) { EmailSetup emailTerm = _emailSetupRepository.getById(emailSetupDto.email_setup_id); if (emailTerm == null) { throw new ItemNotFoundException($"emailterm id {emailSetupDto.email_setup_id} doesnot exist"); } _emailSetupMaker.copy(emailTerm, emailSetupDto); _emailSetupRepository.update(emailTerm); } } catch (Exception) { throw; } }
public void save(EmailSetupDto emailSetupDto) { try { using (TransactionScope txe = new TransactionScope(TransactionScopeOption.Required)) { var emailSetupCategory = _emailSetupRepository.getById(emailSetupDto.email_setup_id); if (emailSetupCategory == null) { throw new ItemNotFoundException($"email setup Category With Id {emailSetupCategory.email_setup_id} doesnot Exist."); } _emailSetupMaker.copy(emailSetupCategory, emailSetupDto); _emailSetupRepository.insert(emailSetupCategory); txe.Complete(); } } catch (Exception ex) { throw ex; } }