示例#1
0
        public List <Object> gerenciaHardwareTO(int acao, String ConnectionString)
        {
            try
            {
                lista_dados = new List <object>();
                dt          = new System.Data.DataTable();
                dt          = _dao.GerenciaHardware(this._codigohw, this._tipohw, this._departamento, this._modelo, 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++)
                            {
                                HardwareTO item = new HardwareTO(false);
                                item.Codigohw     = int.Parse(dt.Rows[x]["CODIGOHW"].ToString());
                                item.Tipohw       = int.Parse(dt.Rows[x]["TIPOHW"].ToString());
                                item.Departamento = int.Parse(dt.Rows[x]["DEPARTAMENTO"].ToString());
                                item.Modelo       = int.Parse(dt.Rows[x]["MODELO"].ToString());
                                lista_dados.Add(item);
                            }
                        }
                    }
                }
                return(lista_dados);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
        public List<Object> gerenciaHardwareTO(int acao, String ConnectionString)
        {
            try
            {
                lista_dados = new List<object>();
                dt = new System.Data.DataTable();
                dt = _dao.GerenciaHardware(this._codigohw, this._tipohw, this._departamento, this._modelo, 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++)
                            {
                                HardwareTO item = new HardwareTO(false);
                                item.Codigohw = int.Parse(dt.Rows[x]["CODIGOHW"].ToString());
                                item.Tipohw = int.Parse(dt.Rows[x]["TIPOHW"].ToString());
                                item.Departamento = int.Parse(dt.Rows[x]["DEPARTAMENTO"].ToString());
                                item.Modelo = int.Parse(dt.Rows[x]["MODELO"].ToString());
                                lista_dados.Add(item);

                            }
                        }
                    }

                }
                return lista_dados;

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }