Esempio n. 1
0
        public List <Object> gerenciaSoftwareTO(int acao, String ConnectionString)
        {
            try
            {
                lista_dados = new List <object>();
                dt          = new System.Data.DataTable();
                dt          = _dao.GerenciaSotware(this._codigosw, this._licenca, this._nomesw, this._marcasw.CodigoMarca, this._categoriasw.CodigoCatSw, 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++)
                            {
                                SoftwareTO item = new SoftwareTO(false);
                                item.CodigoSw = int.Parse(dt.Rows[x]["CODIGOSW"].ToString());
                                item.Licenca  = dt.Rows[x]["LICENCA"].ToString();
                                item.NomeSw   = dt.Rows[x]["NOMESW"].ToString();

                                //Marcas
                                item._marcasw.CodigoMarca  = int.Parse(dt.Rows[x]["CODIGOMARCA"].ToString());
                                item._marcasw.EmailSuporte = dt.Rows[x]["EMAILSUPORTE"].ToString();
                                item._marcasw.NomeMarca    = dt.Rows[x]["NOMEMARCA"].ToString();

                                //Categorias
                                item._categoriasw.CodigoCatSw = int.Parse(dt.Rows[x]["CODIGO"].ToString());
                                item._categoriasw.NomeCatSw   = dt.Rows[x]["DESCRCAT"].ToString();


                                lista_dados.Add(item);
                            }
                        }
                    }
                }
                return(lista_dados);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public List<Object> gerenciaSoftwareTO(int acao, String ConnectionString)
        {
            try
            {
                lista_dados = new List<object>();
                dt = new System.Data.DataTable();
                dt = _dao.GerenciaSotware(this.Codigosw, this._licenca, this._nomesw, this._marcasw, this._categoria_sw, 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++)
                            {
                                SoftwareTO item = new SoftwareTO(false);
                                item.Categoriasw = int.Parse(dt.Rows[x]["CODIGOSW"].ToString());
                                item.Licenca = dt.Rows[x]["LICENCA"].ToString();
                                item.Nomesw = dt.Rows[x]["NOMESW"].ToString();
                                item.Marcasw = int.Parse(dt.Rows[x]["MARCASW"].ToString());
                                item.Categoriasw = int.Parse(dt.Rows[x]["CATEGORIA_SW"].ToString());
                                lista_dados.Add(item);

                            }

                        }

                    }
                }
                return lista_dados;

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }