public static RemoverObjetoResponse <ClientePendenciaCadastralInfo> RemoverClientePendenciaCadastral(RemoverEntidadeRequest <ClientePendenciaCadastralInfo> pParametros) { try { LogarModificacao(pParametros.Objeto, pParametros.IdUsuarioLogado, pParametros.DescricaoUsuarioLogado); var lAcessaDados = new ConexaoDbHelper(); lAcessaDados.ConnectionStringName = gNomeConexaoCadastro; using (var lDbCommand = lAcessaDados.CreateCommand(CommandType.StoredProcedure, "cliente_pendenciacadastral_del_sp")) { lAcessaDados.AddInParameter(lDbCommand, "@id_pendencia_cadastral", DbType.Int32, pParametros.Objeto.IdPendenciaCadastral); lAcessaDados.ExecuteNonQuery(lDbCommand); } var response = new RemoverEntidadeResponse <ClientePendenciaCadastralInfo>() { lStatus = true }; LogCadastro.Logar(pParametros.Objeto, pParametros.IdUsuarioLogado, pParametros.DescricaoUsuarioLogado, LogCadastro.eAcao.Excluir); return(response); } catch (Exception ex) { LogCadastro.Logar(pParametros.Objeto, pParametros.IdUsuarioLogado, pParametros.DescricaoUsuarioLogado, LogCadastro.eAcao.Excluir, ex); throw ex; } }
public static RemoverObjetoResponse <TipoTelefoneInfo> RemoverTipoTelefone(RemoverEntidadeRequest <TipoTelefoneInfo> pParametros) { try { LogarModificacao(pParametros.Objeto, pParametros.IdUsuarioLogado, pParametros.DescricaoUsuarioLogado); ConexaoDbHelper lAcessaDados = new ConexaoDbHelper(); lAcessaDados.ConnectionStringName = gNomeConexaoCadastro; using (DbCommand lDbCommand = lAcessaDados.CreateCommand(CommandType.StoredProcedure, "tipo_telefone_del_sp")) { lAcessaDados.AddInParameter(lDbCommand, "@id_tipo_telefone", DbType.Int32, pParametros.Objeto.IdTipoTelefone); lAcessaDados.ExecuteNonQuery(lDbCommand); } RemoverEntidadeResponse <TipoTelefoneInfo> response = new RemoverEntidadeResponse <TipoTelefoneInfo>() { lStatus = true }; LogCadastro.Logar(pParametros.Objeto, pParametros.IdUsuarioLogado, pParametros.DescricaoUsuarioLogado, LogCadastro.eAcao.Excluir); return(response); } catch (Exception ex) { LogCadastro.Logar(pParametros.Objeto, pParametros.IdUsuarioLogado, pParametros.DescricaoUsuarioLogado, LogCadastro.eAcao.Excluir, ex); throw ex; } }
public static RemoverObjetoResponse <ClienteProcuradorRepresentanteInfo> RemoverClienteProcuradorRepresentante(RemoverEntidadeRequest <ClienteProcuradorRepresentanteInfo> pParametros) { try { LogarModificacao(pParametros.Objeto, pParametros.IdUsuarioLogado, pParametros.DescricaoUsuarioLogado); ConexaoDbHelper lAcessaDados = new ConexaoDbHelper(); lAcessaDados.ConnectionStringName = gNomeConexaoCadastro; var lProcuradorRepresentante = ReceberClienteProcuradorRepresentante(new ReceberEntidadeRequest <ClienteProcuradorRepresentanteInfo>() { Objeto = pParametros.Objeto }); using (DbCommand lDbCommand = lAcessaDados.CreateCommand(CommandType.StoredProcedure, "cliente_procuradorrepresentante_del_sp")) { lAcessaDados.AddInParameter(lDbCommand, "@id_procuradorrepresentante", DbType.Int32, pParametros.Objeto.IdProcuradorRepresentante); lAcessaDados.ExecuteNonQuery(lDbCommand); } RemoverEntidadeResponse <ClienteProcuradorRepresentanteInfo> response = new RemoverEntidadeResponse <ClienteProcuradorRepresentanteInfo>() { lStatus = true }; LogCadastro.Logar(pParametros.Objeto, pParametros.IdUsuarioLogado, pParametros.DescricaoUsuarioLogado, LogCadastro.eAcao.Excluir); //AtualizarOperaPorContaPropria(new ClienteInfo() { IdCliente = lProcuradorRepresentante.Objeto.IdCliente }); return(response); } catch (Exception ex) { LogCadastro.Logar(pParametros.Objeto, pParametros.IdUsuarioLogado, pParametros.DescricaoUsuarioLogado, LogCadastro.eAcao.Excluir, ex); throw ex; } }