Exemplo n.º 1
0
        public List <object> GerenciaAcoesAdmSLATO(int acao, String ConnectionString)
        {
            try
            {
                dt          = new DataTable();
                lista_dados = new List <object>();

                dt = _dao.gerenciaAcoesSLA(this._codigoacaoadmsla, this._acaoadm.Codigo, this._sla.CodigoSLA, 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++)
                            {
                                AcoesAdmSLATO item = new AcoesAdmSLATO(false, true);

                                item.CodigoAcaoAdmSLA = int.Parse(dt.Rows[x]["SLAACAOCODIGO"].ToString());

                                item.Sla.CodigoSLA        = int.Parse(dt.Rows[x]["CODIGO"].ToString());
                                item.Sla.TempoAtendimento = double.Parse(dt.Rows[x]["TEMPOATENDIMENTO"].ToString());

                                item.AcaoAdm.Codigo = int.Parse(dt.Rows[x]["ACAOADMCODIGO"].ToString());

                                item.AcaoAdm.Descricao = dt.Rows[x]["ACAO"].ToString();

                                lista_dados.Add(item);
                            }
                        }
                    }
                }
                return(lista_dados);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public List<object> GerenciaAcoesAdmSLATO(int acao, String ConnectionString)
        {
            try
            {
                dt = new DataTable();
                lista_dados = new List<object>();
                dt = _dao.gerenciaAcoesSLA(this.CodigoAcaoAdmSLA, this.AcaoAdm.Codigo, this.Sla.CodigoSLA, 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++)
                            {
                                AcoesAdmSLATO item = new AcoesAdmSLATO(false, true);
                                item.CodigoAcaoAdmSLA = int.Parse(dt.Rows[x]["SLAACAOCODIGO"].ToString());
                                item.Sla.CodigoSLA = int.Parse(dt.Rows[x]["SLACODIGO"].ToString());
                                item.Sla.TempoAtendimento = double.Parse(dt.Rows[x]["SLATEMPO"].ToString());
                                item.AcaoAdm.Codigo = int.Parse(dt.Rows[x]["ACAOADMCODIGO"].ToString());
                                item.AcaoAdm.Descricao = dt.Rows[x]["ACAO"].ToString();
                                lista_dados.Add(item);
                            }
                        }
                    }

                }
                return lista_dados;
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }