public OcorrenciasTO(bool conbd, bool instanciadependente) { if (conbd) { this._dao = new OcorrenciasDAO(); } if (instanciadependente) { this._status = new StatusTO(false); this._problemas = new ProblemasTO(false, true); this._usuario = new UsuarioTO(true, true, true); } }
public List <Object> GerenciaProblemasTO(int acao, String ConnectionString) { try { lista_dados = new List <Object>(); dt = new DataTable(); dt = _dao.GerenciaProblemas(this._codigo, this._descr, this.Sla.CodigoSLA, this.TipoProblema.Codigo, 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++) { ProblemasTO item = new ProblemasTO(false, true); item.Codigo = int.Parse(dt.Rows[x]["CODIGO"].ToString()); item.Descr = dt.Rows[x]["DESCR"].ToString(); item.Sla.CodigoSLA = int.Parse(dt.Rows[x]["CODIGO"].ToString()); item.Sla.TempoAtendimento = double.Parse(dt.Rows[x]["TEMPOATENDIMENTO"].ToString()); item.TipoProblema.Codigo = int.Parse(dt.Rows[x]["CODIGO"].ToString()); item.TipoProblema.Descr = dt.Rows[x]["DESCR"].ToString(); lista_dados.Add(item); } } } } return(lista_dados); } catch (Exception ex) { throw ex; } }