private void CriarApenasRelacao(IDbConnection dbConnection, CombinadaDTO combinada)
        {
            var servicoContratado = _servicoEAcessoService.BuscarServicoEAcesso(dbConnection, combinada.IdServicoTecnico);
            var deParaAntigo      = _deParaServicoRepository.Buscar(x => x.IdServicoEacesso == combinada.IdServicoTecnico).FirstOrDefault();
            var vinculo           = new VinculoServicoCelulaComercial
            {
                IdCelulaComercial   = ObterCelulaPorServico(dbConnection, combinada.IdServicoComercial),
                DataInicial         = servicoContratado.DtInicial,
                DataFinal           = servicoContratado.DtFinal,
                IdServicoContratado = deParaAntigo.IdServicoContratado
            };

            _vinculoServicoCelulaComercialService.Adicionar(vinculo);

            var deParaNovo = new DeParaServico
            {
                IdServicoEacesso    = combinada.IdServicoComercial,
                IdServicoContratado = deParaAntigo.IdServicoContratado,
                DescStatus          = "MA",
                DescTipoServico     = ""
            };

            _deParaServicoRepository.Adicionar(deParaNovo);
            _unitOfWork.Commit();
        }
示例#2
0
 public void Adicionar(VinculoServicoCelulaComercial vinculoServicoCelulaComercial)
 {
     _vinculoServicoCelulaComercialRepository.Adicionar(vinculoServicoCelulaComercial);
 }