public List <Object> GerenciaCategoriasSwTO(int acao, String ConnectionString) { try { lista_dados = new List <object>(); dt = new System.Data.DataTable(); dt = _dao.GerenciaCategoriasSW(this._codigocatsw, this._nomecatsw, 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++) { CategoriasSwTO item = new CategoriasSwTO(false); item.CodigoCatSw = int.Parse(dt.Rows[x]["CODIGOCATSW"].ToString()); item.NomeCatSw = dt.Rows[x]["NOMECATSW"].ToString(); lista_dados.Add(item); } } } } return(lista_dados); } catch (Exception ex) { throw ex; } }
public List<Object> gerenciaCategoriasSwTO(int acao, String ConnectionString) { try { lista_dados = new List<object>(); dt = new System.Data.DataTable(); dt = _dao.GerenciaCategoriasSW(this.CodigoCatSw, this.NomeCatSw, 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++) { CategoriasSwTO item = new CategoriasSwTO(false); item.CodigoCatSw = int.Parse(dt.Rows[x]["CODIGOCATSW"].ToString()); item.NomeCatSw = int.Parse(dt.Rows[x]["NOMECATSW"].ToString()); lista_dados.Add(item); } } } } return lista_dados; } catch (Exception ex) { throw ex; } }