コード例 #1
0
ファイル: ComponentesTO.cs プロジェクト: reynaldus/wiseadmin
        public ComponentesTO(bool conbd, bool instanciadependente)
        {
            try
            {
                if (conbd)
                {
                    this._dao = new ComponentesDAO();
                }

                if (instanciadependente)
                {
                    _modelo   = new ModelosTO(true, false);
                    _tipocomp = new TipoComponentesTO(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
ファイル: ComponentesTO.cs プロジェクト: reynaldus/wiseadmin
        public ComponentesTO(bool conbd, bool instanciadependente)
        {
            try
            {
                if (conbd)
                {
                    this._dao = new ComponentesDAO();
                }

                if (instanciadependente)
                {
                    _modelo = new ModelosTO(true, false);
                    _tipocomp = new TipoComponentesTO(false);
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
コード例 #3
0
        public List<Object> GerenciaTipoComponentesTO(int acao, String ConnectionString)
        {
            try
            {
                lista_dados = new List<Object>();
                dt = new System.Data.DataTable();
                dt = _dao.GerenciaTipoComponentes(this._codigotpcomp, this._nometpcomp, 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++)
                            {
                                TipoComponentesTO item = new TipoComponentesTO(false);
                                item.CodigoTpComp = int.Parse(dt.Rows[x]["CODIGOTPCOMP"].ToString());
                                item.NomeTpComp = dt.Rows[x]["NOMETPCOMP"].ToString();
                                lista_dados.Add(item);

                            }
                        }
                    }
                }
                return lista_dados;
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
コード例 #4
0
        public List <Object> GerenciaTipoComponentesTO(int acao, String ConnectionString)
        {
            try
            {
                lista_dados = new List <Object>();
                dt          = new System.Data.DataTable();
                dt          = _dao.GerenciaTipoComponentes(this._codigotpcomp, this._nometpcomp, 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++)
                            {
                                TipoComponentesTO item = new TipoComponentesTO(false);
                                item.CodigoTpComp = int.Parse(dt.Rows[x]["CODIGOTPCOMP"].ToString());
                                item.NomeTpComp   = dt.Rows[x]["NOMETPCOMP"].ToString();
                                lista_dados.Add(item);
                            }
                        }
                    }
                }
                return(lista_dados);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }