Exemplo n.º 1
0
        public OcorrenciasTO(bool conbd, bool instanciadependente)

        {
            if (conbd)
            {
                this._dao = new OcorrenciasDAO();
            }

            if (instanciadependente)
            {
                this._status    = new StatusTO(false);
                this._problemas = new ProblemasTO(false, true);
                this._usuario   = new UsuarioTO(true, true, true);
            }
        }
Exemplo n.º 2
0
        public List <object> GerenciaStatusTO(int acao, String ConnectionString)
        {
            try
            {
                lista_dados = new List <object>();
                dt          = new DataTable();
                dt          = _dao.GerenciaStatus(this._codigo, this._descr, acao, ConnectionString);

                if (!(dt == null))
                {
                    if (dt.Rows.Count > 0)
                    {
                        if (acao != 2)
                        {
                            lista_dados.Add(dt.Rows[0][0].ToString());
                        }
                        else
                        {
                            for (int x = 0; x < dt.Rows.Count; x++)
                            {
                                StatusTO item = new StatusTO(false);
                                item.Codigo = int.Parse(dt.Rows[x]["CODIGO"].ToString());
                                item.Descr  = dt.Rows[x]["DESCR"].ToString();

                                lista_dados.Add(item);
                            }
                        }
                    }
                }

                return(lista_dados);
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }