Exemple #1
0
        public ModelosTO(bool conbd, bool instanciadependente)
        {
            try
            {
                if (conbd)
                {
                    this._dao = new ModelosDAO();
                }

                if (instanciadependente)
                {
                    this._marca = new MarcasTO(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
        public ModelosTO(bool conbd, bool instanciadependente)
        {
            try
            {
                if (conbd)
                {
                    this._dao = new ModelosDAO();
                }

                if (instanciadependente)
                {
                    this._marca = new MarcasTO(false);
                }

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
Exemple #3
0
        public List <Object> gerenciaMarcasTO(int acao, String ConnectionString)
        {
            try
            {
                lista_dados = new List <object>();
                dt          = new System.Data.DataTable();
                dt          = _dao.GerenciaMarcas(this._codigomarca, this._emailsuporte, this._nomemarca, 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++)
                            {
                                MarcasTO item = new MarcasTO(false);

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

                                lista_dados.Add(item);
                            }
                        }
                    }
                }
                return(lista_dados);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #4
0
        public List<Object> gerenciaMarcasTO(int acao, String ConnectionString)
        {
            try
            {
                lista_dados = new List<object>();
                dt = new System.Data.DataTable();
                dt = _dao.GerenciaMarcas(this._codigomarca, this._emailsuporte, this._nomemarca, 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++)
                            {
                                MarcasTO item = new MarcasTO(false);
                                item.CodigoMarca = int.Parse(dt.Rows[x]["CODIGOMARCA"].ToString());
                                item.EmailSuporte = dt.Rows[x]["EMAILSUPORTE"].ToString();
                                item.NomeMarca = dt.Rows[x]["NOMEMARCA"].ToString();
                                lista_dados.Add(item);

                            }

                        }
                    }
                }
                return lista_dados;

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }