Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        public List <Object> GerenciaModelosTO(int acao, String ConnectionString)
        {
            try
            {
                lista_dados = new List <object>();
                dt          = new System.Data.DataTable();
                dt          = _dao.GerenciaModelos(this._codigomodel, this._descrmodel, this._marca.CodigoMarca, 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++)
                            {
                                ModelosTO item = new ModelosTO(false, true);
                                item.CodigoModel = int.Parse(dt.Rows[x]["CODIGOMODEL"].ToString());
                                item.DescModel   = dt.Rows[x]["DESCRMODEL"].ToString();

                                //MARCA
                                item._marca.CodigoMarca  = int.Parse(dt.Rows[x]["CODIGOMARCA"].ToString());
                                item._marca.EmailSuporte = dt.Rows[x]["EMAILSUPORTE"].ToString();
                                item._marca.NomeMarca    = dt.Rows[x]["NOMEMARCA"].ToString();

                                lista_dados.Add(item);
                            }
                        }
                    }
                }
                return(lista_dados);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
        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;
            }
        }
Ejemplo n.º 4
0
        public List<Object> GerenciaModelosTO(int acao, String ConnectionString)
        {
            try
            {
                lista_dados = new List<object>();
                dt = new System.Data.DataTable();
                dt = _dao.GerenciaModelos(this._codigomodel, this._descrmodel, this._marca, 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++)
                            {
                                ModelosTO item = new ModelosTO(false);
                                item.CodigoModel = int.Parse(dt.Rows[x]["CODIGOMODEL"].ToString());
                                item.DescModel = dt.Rows[x]["DESCRMODEL"].ToString();
                                item.Marca = int.Parse(dt.Rows[x]["MARCA"].ToString());
                                lista_dados.Add(item);

                            }
                        }

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

                throw ex;
            }
        }