コード例 #1
0
        private void BtEdit_Click(object sender, EventArgs e)
        {
            if (lstMain.SelectedItem == null)
            {
                return;
            }
            inputBox iBox = new inputBox();
            String   sCod = iBox.Show(lstMain.Text, "Informação", "Digite o nome do assunto.", 40);

            if (!string.IsNullOrEmpty(sCod))
            {
                Processo_bll processo_class = new Processo_bll(_connection);
                Assunto      reg            = new Assunto();
                GtiTypes.CustomListBoxItem2 selectedData = (GtiTypes.CustomListBoxItem2)lstMain.SelectedItem;
                reg.Codigo = Convert.ToInt16(selectedData._value);
                reg.Nome   = sCod.ToUpper();
                reg.Ativo  = Convert.ToBoolean(selectedData._ativo);
                Exception ex = processo_class.Alterar_Assunto(reg);
                if (ex != null)
                {
                    ErrorBox eBox = new ErrorBox("Atenção", "Assunto já cadastrado.", ex);
                    eBox.ShowDialog();
                }
                else
                {
                    Carrega_Lista(bSoAtivo, bSoNAtivo);
                }
            }
        }
コード例 #2
0
        public int GetLastId(Assunto ass)
        {
            int codigo = 0;

            IDbCommand    objCommand;
            IDbConnection objConexao;
            IDataReader   objDataReader;

            string sql = "SELECT * FROM ASS_ASSUNTO WHERE ASS_ASSUNTO = ?assunto";

            objConexao = Mapped.Connection();
            objCommand = Mapped.Command(sql, objConexao);
            objCommand.Parameters.Add(Mapped.Parameter("?assunto", ass.Descricao));

            objDataReader = objCommand.ExecuteReader();
            while (objDataReader.Read())
            {
                codigo = Convert.ToInt32(objDataReader["ASS_CODIGO"]);
            }

            objConexao.Close();
            objDataReader.Close();

            objConexao.Dispose();
            objCommand.Dispose();
            objDataReader.Dispose();

            return(codigo);
        }
コード例 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Titulo")] Assunto assunto)
        {
            if (id != assunto.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    assunto.DataHoraModificacao = DateTime.Now;
                    _context.Update(assunto);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AssuntoExists(assunto.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(assunto));
        }
コード例 #4
0
        public async Task <IActionResult> put(int assuntoId, Assunto model)
        {
            try
            {
                var assunto = await _repo.GetAssuntoAsyncByAssuntoId(assuntoId, false);

                if (assunto == null)
                {
                    return(NotFound());
                }

                _repo.Update(model);

                if (await _repo.SaveChangesAsync())
                {
                    return(Ok(model));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest($"Erro: {ex.Message}"));
            }

            return(BadRequest());
        }
コード例 #5
0
        public override void Save(Mensagem entity)
        {
            int        usuarioEmissorId           = entity.UsuarioEmissorId;
            Usuario    usuarioEmissor             = _db.Usuario.FirstOrDefault(x => x.Id == usuarioEmissorId);
            Condominio condominioDoUsuarioEmissor = _db.Condominio.FirstOrDefault(x => x.Id == usuarioEmissor.CondominioId);
            Assunto    assunto = _db.Assunto.FirstOrDefault(x => x.Id == entity.AssuntoId);

            if (assunto.Tipo.Equals("Condominal"))
            {
                if (condominioDoUsuarioEmissor.UsuarioSindicoId.HasValue)
                {
                    entity.AdministradoraResponsavelId = null;
                    entity.UsuarioResponsavelId        = condominioDoUsuarioEmissor.UsuarioSindicoId.Value;
                }
                else if (condominioDoUsuarioEmissor.UsuarioZeladorId.HasValue)
                {
                    entity.AdministradoraResponsavelId = null;
                    entity.UsuarioResponsavelId        = condominioDoUsuarioEmissor.UsuarioZeladorId.Value;
                }
                else
                {
                    throw new ArgumentException("O condomínio não possui síndico nem zelador para receber a mensagem!");
                }
            }
            else
            {
                entity.AdministradoraResponsavelId = condominioDoUsuarioEmissor.AdministradoraId;
                entity.UsuarioResponsavelId        = null;
            }

            entity.DateCreated = DateTime.Now;
            base.Save(entity);
        }
コード例 #6
0
        public Task <int> Handle(UpdateAssuntoCommand request, CancellationToken cancellationToken)
        {
            if (!request.IsValid())
            {
                NotifyValidationErrors(request);
                return(Task.FromResult(0));
            }

            var assunto         = new Assunto(request.Id, request.Descricao);
            var existingAssunto = _assuntoRepository.GetAsNoTracking(x => assunto.Descricao.Contains(x.Descricao));

            if (!existingAssunto.Equals(assunto))
            {
                Bus.RaiseEvent(new DomainNotification(request.MessageType, "O Assunto já está sendo usado."));
                return(Task.FromResult(0));
            }

            _assuntoRepository.Update(assunto);

            if (Commit())
            {
                //TO DO
            }

            return(Task.FromResult(assunto.Id));
        }
コード例 #7
0
 private void ValidateAssunto(Assunto entity, bool delete)
 {
     if (entity.Descricao.IsNullOrEmpty() && !delete)
     {
         throw new ApplicationException("Assunto: O campo 'Descrição' é obrigatório.");
     }
 }
コード例 #8
0
        public IEnumerable <IEntity> Consultar(IEntity entity)
        {
            Assunto assunto = (Assunto)entity;

            // faz um select no banco de dados
            var assuntos = _context.Assuntos.Include(e => e.Livros);

            // Se foi passado um Id | retorna uma lista de entidades
            if (assunto.Id == 0)
            {
                // Se não foi passada uma descrição da entidade | retorna todas as entidades
                if (assunto.ass_descricao == null)
                {
                    return(assuntos.ToList());
                }

                // Se foi passada uma descrição da entidade | retorna todas as entidades com a descrição
                return(assuntos.Where(l => l.ass_descricao == assunto.ass_descricao).ToList());
            }
            else
            {
                // Se foi passado um Id | retorna a entidade especificada
                return(assuntos.Where(l => l.Id == assunto.Id).ToList());
            }
        }
コード例 #9
0
        public Task <int> Handle(RegisterNewAssuntoCommand request, CancellationToken cancellationToken)
        {
            if (!request.IsValid())
            {
                NotifyValidationErrors(request);
                return(Task.FromResult(0));
            }

            var assunto = new Assunto(request.Descricao);

            if (_assuntoRepository.Exists(assunto.Descricao))
            {
                Bus.RaiseEvent(new DomainNotification(request.MessageType, "O Assunto já está sendo usado."));
                return(Task.FromResult(0));
            }

            _assuntoRepository.Add(assunto);

            if (Commit())
            {
                //TO DO
            }

            return(Task.FromResult(assunto.Id));
        }
コード例 #10
0
        public Assunto Select(int codigo)
        {
            Assunto ass = null;

            IDbCommand    objCommand;
            IDbConnection objConexao;
            IDataReader   objDataReader;

            string sql = "SELECT * FROM ASS_ASSUNTO WHERE ASS_CODIGO = ?codigo";

            objConexao = Mapped.Connection();
            objCommand = Mapped.Command(sql, objConexao);
            objCommand.Parameters.Add(Mapped.Parameter("?codigo", codigo));

            objDataReader = objCommand.ExecuteReader();
            while (objDataReader.Read())
            {
                ass           = new Assunto();
                ass.Codigo    = Convert.ToInt32(objDataReader["ASS_CODIGO"]);
                ass.Descricao = Convert.ToString(objDataReader["ASS_ASSUNTO"]);
            }

            objConexao.Close();
            objDataReader.Close();

            objConexao.Dispose();
            objCommand.Dispose();
            objDataReader.Dispose();

            return(ass);
        }
コード例 #11
0
        public long SaveAssunto(Assunto entity)
        {
            var retorno = Contexto.Assunto.Add(entity);

            Contexto.SaveChanges();
            return(retorno.Id);
        }
コード例 #12
0
        public Exception Alterar_Assunto(Assunto reg)
        {
            Processo_Data obj = new Processo_Data(_connection);
            Exception     ex  = obj.Alterar_Assunto(reg);

            return(ex);
        }
コード例 #13
0
        public async Task <ChamadoDTO> Cadastrar(ChamadoDTO chamadoDto)
        {
            Usuario      cliente      = null;
            Assunto      assunto      = null;
            Departamento departamento = null;
            Franquia     franquia     = null;

            cliente = await _unitOfWork.UsuarioRepositorio.Consultar(chamadoDto.ClienteId);

            assunto = await _unitOfWork.AssuntoRepositorio.Consultar(chamadoDto.AssuntoId);

            franquia = await _unitOfWork.FranquiaRepositorio.ConsultarPorId(chamadoDto.FranquiaId);

            if (assunto != null)
            {
                departamento = await _unitOfWork.DepartamentoRepositorio
                               .Consultar(assunto.DepartamentoId);
            }

            if (cliente != null && departamento != null && franquia != null)
            {
                var chamado = new Chamado();
                chamado.AssuntoId           = assunto.Id;
                chamado.Assunto             = assunto;
                chamado.ClienteId           = cliente.Id;
                chamado.PrioridadeId        = chamadoDto.PrioridadeId;
                chamado.Situacao            = Situacao.AguardandoRespostaAtendente;
                chamado.Status              = Status.EmProcesso;
                chamado.DepartamentoId      = departamento.Id;
                chamado.Departamento        = departamento;
                chamado.DataAbertura        = DateTime.Now;
                chamado.DataUltimaInteracao = DateTime.Now;
                chamado.Protocolo           = await GerarProtocolo();

                chamado.FranquiaId = franquia.Id;

                var mensagem = new Mensagem();
                mensagem.Conteudo    = chamadoDto.MensagemInicial;
                mensagem.ChamadoId   = chamado.Id;
                mensagem.Chamado     = chamado;
                mensagem.UsuarioId   = cliente.Id;
                mensagem.Usuario     = cliente;
                mensagem.DataCriacao = DateTime.Now;

                chamado.Mensagens.Add(mensagem);

                await _unitOfWork.ChamadoRepositorio.Adicionar(chamado);

                await _unitOfWork.MensagemRepositorio.Adicionar(mensagem);

                await _unitOfWork.Commit();

                return(_mapper.Map <ChamadoDTO>(chamado));
            }
            else
            {
                return(null);
            }
        }
コード例 #14
0
 public void Delete(Assunto a)
 {
     using (DataContext ctx = new DataContext())
     {
         ctx.Entry(a).State = EntityState.Deleted;
         ctx.SaveChanges();
     }
 }
コード例 #15
0
 public void Insert(Assunto a)
 {
     using (DataContext ctx = new DataContext())
     {
         ctx.Entry(a).State = EntityState.Added;
         ctx.SaveChanges();
     }
 }
コード例 #16
0
        public ActionResult DeleteConfirmed(int id)
        {
            Assunto assunto = db.Assunto.Find(id);

            db.Assunto.Remove(assunto);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #17
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Assunto assunto = await crud.ListById(Querys.SELECT_ASSUNTO, id);

            await crud.Delete(Querys.DELETE_ASSUNTO, id);

            return(RedirectToAction("Index"));
        }
コード例 #18
0
 private void Excluir(Assunto assunto)
 {
     using (AssuntoRepository repo = new AssuntoRepository())
     {
         repo.Excluir(assunto);
         var assuntoRet = repo.Obter(assunto.Id);
         Assert.IsTrue(assuntoRet == null);
     }
 }
コード例 #19
0
        public async Task Update(Assunto entity)
        {
            if (!RunValidation(new AssuntoValidation(), entity))
            {
                return;
            }

            await _dbAssunto.Update(entity);
        }
コード例 #20
0
        public ActionResult RemoverAssuntos(int AssuntoID)
        {
            Assunto assunto = QuestaoDAO.BuscarAssuntoId(AssuntoID);

            QuestaoDAO.RemoverAssunto(assunto);

            TempData["$CadAssunto$"] = "Assunto Removido com Sucesso";
            return(RedirectToAction("CadastrarAssunto", "CadastrarQuestoes"));
        }
コード例 #21
0
        public ActionResult Editar(Assunto assunto)
        {
            using (var repo = new AssuntoRepository())
            {
                assunto = repo.Atualizar(assunto);

                return(RedirectToAction("Index"));
            }
        }
コード例 #22
0
        public ActionResult DeleteConfirmed(int id)
        {
            MeuContexto contexto = new MeuContexto();
            Assunto     ass      = contexto.Assuntos.Find(id);

            contexto.Assuntos.Remove(ass);
            contexto.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #23
0
        public Assunto TransformarAssuntoModelEmAssunto(AssuntoModel assuntoModel)
        {
            var assunto = new Assunto();

            assunto.Id        = assuntoModel.Id;
            assunto.Descricao = assuntoModel.Descricao;

            return(assunto);
        }
コード例 #24
0
        public AssuntoModel TransformarAssuntoEmAssuntoModel(Assunto assunto)
        {
            var assuntoModel = new AssuntoModel();

            assuntoModel.Id        = assunto.Id;
            assuntoModel.Descricao = assunto.Descricao;

            return(assuntoModel);
        }
コード例 #25
0
 public ActionResult Edit([Bind(Include = "AssuntoID,Assunto1")] Assunto assunto)
 {
     if (ModelState.IsValid)
     {
         db.Entry(assunto).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(assunto));
 }
コード例 #26
0
        public ActionResult EditarAssuntos(int AssuntoID, string AssuntoDesc)
        {
            Assunto assunto = QuestaoDAO.BuscarAssuntoId(AssuntoID);

            assunto.Descricao = "teste";

            QuestaoDAO.EditarAssunto(assunto);
            TempData["$CadAssunto$"] = "Assunto Alterado com Sucesso";
            return(RedirectToAction("CadastrarAssunto", "CadastrarQuestoes"));
        }
コード例 #27
0
        public ActionResult CadastrarAssuntos(string AssuntoQ)
        {
            Assunto assunto = new Assunto();

            assunto.Descricao = AssuntoQ;

            QuestaoDAO.CadastrarAssunto(assunto);
            TempData["$CadAssunto$"] = "Assunto Criado com Sucesso";
            return(RedirectToAction("CadastrarAssunto", "CadastrarQuestoes"));
        }
コード例 #28
0
 public IActionResult Edit(Assunto assunto)
 {
     if (ModelState.IsValid)
     {
         this.Banco.Entry(assunto).State = EntityState.Modified;
         this.Banco.SaveChanges();
         return(RedirectToAction("/Assuntos/Index"));
     }
     return(View(assunto));
 }
コード例 #29
0
 public IActionResult Create(Assunto assunto)
 {
     if (ModelState.IsValid)
     {
         this.Banco.Assuntos.Add(assunto);
         this.Banco.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(assunto));
 }
コード例 #30
0
        public async Task <ActionResult> Edit([Bind(Include = "ID, NOME")] Assunto assunto)
        {
            if (ModelState.IsValid)
            {
                await crud.Update(Querys.UPDATE_ASSUNTO, assunto.NOME, assunto.ID);

                return(RedirectToAction("Index"));
            }
            return(View(assunto));
        }
コード例 #31
0
        public System.Data.DataTable getProximaUnidadeFuncionalByFluxoNova(string processoID, string idAssunto, string situacaoID, string undOrcID)
        {
            SituacaoCtrl controleSituacao = new SituacaoCtrl();
            Assunto controleAssunto = new Assunto();
            TramiteCtrl controleTramite = new TramiteCtrl();
            FluxoAssuntoCtrl controleFluxoAssunto = new FluxoAssuntoCtrl();

            string fluxoAtual = controleFluxoAssunto.getFluxoAtual(processoID);

            string unidCod = undOrcID.ToString().Substring(2, 2);
            string unidORG = undOrcID.ToString().Substring(0, 2);

            Situacao situacao = new Situacao();
            List<string> UnidadesFuncionais = new List<string>();

            string ordenacao = "";
            string sqlAssunto = "select * from webassunto where id = " + idAssunto; //Verifica se Assunto tem fluxo definido

            FbConnection conn = Persist.GetConn.getConn();
            conn.Open();
            FbCommand cmdAssunto = new FbCommand(sqlAssunto, conn);

            FirebirdSql.Data.FirebirdClient.FbDataReader drAssunto = cmdAssunto.ExecuteReader();
            while (drAssunto.Read())
            {
                ordenacao = drAssunto["EXIGEORDENACAO"].ToString();
            }
            drAssunto.Close();
            drAssunto.Dispose();
            cmdAssunto.Dispose();

            if (!ordenacao.Equals("1")) //Se não tem fluxo definido...
            {
                string sqlUND = "Select * from webunidadefuncional where unidorccod = " + unidCod + "  unidorcorg = " + unidORG;

                FbCommand cmdUND = new FbCommand(sqlUND, conn);

                FirebirdSql.Data.FirebirdClient.FbDataReader drUND = cmdUND.ExecuteReader();
                while (drUND.Read())
                {
                    UnidadesFuncionais.Add(drUND["UNIDFUNCID"].ToString());
                }
                drUND.Close();
                drUND.Dispose();
                cmdUND.Dispose();
            }
            else//Se tem fluxo definido...
            {
                if (controleSituacao.ehFinalDeFluxo(situacaoID)) //Se Situação selecionada indicar fim de fluxo
                {
                    UndFuncionalCtrl controleUndFuncional = new UndFuncionalCtrl();
                    string undFunc = controleUndFuncional.getUnidadeFuncionalArquivo();
                    UnidadesFuncionais.Add(undFunc);
                }
                else
                {
                    if (controleSituacao.TramiteTemSituacaoDeExcessao(controleTramite.RetornaUltimoTramite(processoID).ToString())) //Se o tramite indica um Fluxo que não seja natural (volta à um passo a frente)
                    {
                        string FlagSituacaoVolta = "";
                        string sqlExcVolta = "Select FLAG_SITUACAO_VOLTA from WEBTRAMITE WHERE ID =  " + controleTramite.RetornaUltimoTramite(processoID).ToString();

                        FbCommand cmdExcVolta = new FbCommand(sqlExcVolta, conn);

                        FirebirdSql.Data.FirebirdClient.FbDataReader drEX = cmdExcVolta.ExecuteReader();
                        while (drEX.Read())
                        {
                            FlagSituacaoVolta = drEX["FLAG_SITUACAO_VOLTA"].ToString();
                        }
                        drEX.Close();
                        drEX.Dispose();
                        cmdExcVolta.Dispose();

                        string sqlExc = "select * from unidadeorcamentaria uo " +
                                        "join webunidadefuncional uf on uf.unidorccod = uo.undcodigo and uf.unidorcorg = uo.undcodorgao " +
                                        "join webfluxoassunto fa on fa.idundfuncional = uf.unidfuncid " +
                                        "where fa.fluxoID = " + FlagSituacaoVolta + " and fa.idassunto = " + idAssunto;

                        FbCommand cmdExc = new FbCommand(sqlExc, conn);

                        FirebirdSql.Data.FirebirdClient.FbDataReader dr = cmdExc.ExecuteReader();

                        while (dr.Read())
                        {
                            UnidadesFuncionais.Add(dr["UNIDFUNCID"].ToString());
                        }
                        dr.Close();
                        dr.Dispose();
                        cmdExc.Dispose();

                    }
                    else
                    {
                        object situacaoRetorno = null;
                        object flagOrigem = null;

                        string sqlSituacao = "Select * from WEBSITUACAOPROCESSO WHERE ID = " + situacaoID; //Verifica situacao do processo selecionada pelo usuario

                        FbConnection connSit = Persist.GetConn.getConn();
                        FbCommand cmdSituacao = new FbCommand(sqlSituacao, connSit);
                        connSit.Open();
                        FirebirdSql.Data.FirebirdClient.FbDataReader drSituacao = cmdSituacao.ExecuteReader();
                        while (drSituacao.Read())
                        {
                            situacaoRetorno = drSituacao["FLUXOID"];
                            flagOrigem = drSituacao["FLAGORIGEM"];
                        }
                        connSit.Close();
                        drSituacao.Close();
                        drSituacao.Dispose();
                        cmdSituacao.Dispose();

                        if (!string.IsNullOrEmpty(flagOrigem.ToString()))
                        {
                            if (string.IsNullOrEmpty(situacaoRetorno.ToString()))
                            {
                                object unidFuncional = null;
                                string sql = "select first 1 idundfuncorigem from webtramite where idprocesso = " + processoID + "ORDER BY ID ASC";

                                FbCommand cmd = new FbCommand(sql, conn);

                                FirebirdSql.Data.FirebirdClient.FbDataReader dr = cmd.ExecuteReader();
                                while (dr.Read())
                                {
                                    unidFuncional = dr["IDUNDFUNCORIGEM"];
                                    UnidadesFuncionais.Add(dr["IDUNDFUNCORIGEM"].ToString());

                                }
                                dr.Close();
                                dr.Dispose();
                                cmd.Dispose();
                            }
                            else {//ALTERACAO 04062014
                                object unidFuncional = null;
                                string sql = "select (CASE WHEN IDUNDFUNCIONAL IS NULL THEN (select first 1 idundfuncorigem from webtramite where idprocesso = " + processoID + " ORDER BY ID ASC)"+
                                            " ELSE IDUNDFUNCIONAL END) IDUNDFUNCIONAL from webfluxoassunto WHERE FLUXOID = " + situacaoRetorno;
                                FbCommand cmd = new FbCommand(sql, conn);

                                FirebirdSql.Data.FirebirdClient.FbDataReader dr = cmd.ExecuteReader();
                                while (dr.Read())
                                {
                                    unidFuncional = dr["IDUNDFUNCIONAL"];
                                    UnidadesFuncionais.Add(dr["IDUNDFUNCIONAL"].ToString());

                                }
                                dr.Close();
                                dr.Dispose();
                                cmd.Dispose();
                            }
                        }
                        else
                        {
                            if (string.IsNullOrEmpty(situacaoRetorno.ToString()))// Se não tem parametro de retorno definido -> Segue Fluxo normal
                            {
                                object unidFuncional = null;

                                string sqlFluxo = "select fluxoID, ordem," +
                                                    "(CASE WHEN idundfuncional IS NULL then (select first 1 TRA.idundfuncorigem from webtramite TRA where idprocesso = " + processoID + " order by id ASC) " +
                                                    "    ELSE " +
                                                    "        (select IDUNDFUNCIONAL from web_fluxo_filhos flf1 join webfluxoassunto flx1 on flx1.fluxoid = flf1.id_fluxo_filho " +
                                                    "            where flf1.id_fluxo_filho = flf.id_fluxo_filho and flf1.id_fluxo_pai = flf.id_fluxo_pai) END) UNDFUNC " +
                                                    "from web_fluxo_filhos flf join webfluxoassunto flx on flf.id_fluxo_filho = flx.fluxoid " +
                                                    "where flf.id_fluxo_pai = ( select first 1 FluxoID from webtramite tra where tra.idprocesso = " + processoID + " order by ID desc)";
                                //CORREÇÃO 21/03/2014
                                FbConnection connFlx = Persist.GetConn.getConn();
                                FbCommand cmd = new FbCommand(sqlFluxo, connFlx);
                                connFlx.Open();
                                FirebirdSql.Data.FirebirdClient.FbDataReader drFluxo = cmd.ExecuteReader();
                                while (drFluxo.Read())
                                {
                                    unidFuncional = drFluxo["UNDFUNC"];
                                    UnidadesFuncionais.Add(drFluxo["UNDFUNC"].ToString());

                                }
                                connFlx.Close();
                                drFluxo.Close();
                                drFluxo.Dispose();
                                cmd.Dispose();
                            }
                            else //Se a situacao selecionada tem paramtro de retorno definido -> Buscar a Unidade Funcional referente ao fluxo definido como retorno na situacao
                            {
                                object unidFuncional = null;

                                string sqlRetorno = "Select " +
                                                    "CASE WHEN IDUNDFUNCIONAL IS NULL THEN " +
                                                    "    (SELECT FIRST 1 TRA.idundfuncorigem FROM WEBTRAMITE TRA WHERE IDPROCESSO = " + processoID + ") " +
                                                    "    ELSE IDUNDFUNCIONAL end IDUNDFUNC " +
                                                    "from WEBFLUXOASSUNTO where FLUXOID = " + situacaoRetorno.ToString();
                                FbCommand cmd = new FbCommand(sqlRetorno, conn);

                                FirebirdSql.Data.FirebirdClient.FbDataReader drRet = cmd.ExecuteReader();
                                while (drRet.Read())
                                {
                                    unidFuncional = drRet["IDUNDFUNC"].ToString();
                                    UnidadesFuncionais.Add(drRet["IDUNDFUNC"].ToString());

                                }

                                drRet.Close();
                                drRet.Dispose();
                                cmd.Dispose();
                            }
                        }
                    }
                }
                conn.Close();
            }

            System.Data.DataTable table = new System.Data.DataTable();
            table.Columns.Add("UNIDFUNCID", typeof(string));
            table.Columns.Add("UNIDFUNCNOME", typeof(string));

            foreach (string UndFunc in UnidadesFuncionais)
            {
                UnidadeFuncional undFunc = new UnidadeFuncional();
                undFunc = getUndFuncByID(UndFunc);
                System.Data.DataRow[] drow = table.Select("UNIDFUNCID =" + undFunc.ID);
                table.Rows.Add(undFunc.ID, undFunc.unidFuncNome);
            }

            conn.Close();
            //conn.Dispose();

            controleSituacao = null;
            controleAssunto = null;
            controleTramite = null;
            controleFluxoAssunto = null;
            situacao = null;

            return table;
        }
コード例 #32
0
ファイル: Util.cs プロジェクト: aureliopires/gisa
        public static Document AssuntosToLuceneDocument(Assunto assunto)
        {
            Field id = new Field("id", assunto.Id, Field.Store.YES, Field.Index.NOT_ANALYZED);
            Field formaAutorizada = new Field("formaAutorizada", assunto.FormaAutorizada, Field.Store.YES, Field.Index.ANALYZED);
            Field tipoNoticia = new Field("tipoNoticia", assunto.TipoNoticia, Field.Store.NO, Field.Index.ANALYZED);
            Field designacao = new Field("designacao", assunto.Designacao, Field.Store.NO, Field.Index.ANALYZED);
            Field validado = new Field("validado", assunto.Validado, Field.Store.NO, Field.Index.ANALYZED);

            Document doc = new Document();
            doc.Add(id);
            doc.Add(formaAutorizada);
            doc.Add(tipoNoticia);
            doc.Add(designacao);
            doc.Add(validado);

            return doc;
        }
コード例 #33
0
 public NovaCategoriaSpecification(Assunto categoriaNova, IList<Assunto> categoriasExistentes)
 {
     _categoriaNova = categoriaNova;
     _categoriasExistentes = categoriasExistentes;
 }