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; } }
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; } }
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; } }