コード例 #1
0
    public string traer_categorias_productos()
    {
        try
        {
            try
            {
                if (SoapHeader == null)
                {
                    throw new Exception("Requiere Validacion");
                }

                if (!SoapHeader.blCredencialesValidas(SoapHeader))
                {
                    throw new Exception("Requiere Validacion");
                }
                L_WebService logi = new L_WebService();
                string       res  = JsonConvert.SerializeObject(logi.get_all_Cate());
                return(res);
            }
            catch (Exception ex)
            {
                return("Ha Ocurrido Un Error Inesperado " + ex.Message);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
コード例 #2
0
    public string traer_por_categoria(int id_categoria)
    {
        try
        {
            if (SoapHeader == null)
            {
                throw new Exception("Requiere Validacion");
            }

            if (!SoapHeader.blCredencialesValidas(SoapHeader))
            {
                throw new Exception("Requiere Validacion");
            }
            try
            {
                L_WebService             logi = new L_WebService();
                List <UEUVista_Tot_Prod> inf  = logi.busqueda(id_categoria);
                foreach (UEUVista_Tot_Prod aux in inf)
                {
                    aux._foto = "http://compramatic.hopto.org:88/Archivos/FotosProductos/" + aux._foto;
                }
                ListToDataTable conv   = new ListToDataTable();
                DataTable       retorn = conv.ToDataTable(inf);
                string          res    = JsonConvert.SerializeObject(retorn);
                DataTable       test   = JsonConvert.DeserializeObject <DataTable>(res);
                return(res);
            }
            catch (Exception ex)
            {
                return("Ha Ocurrido Un Error Inesperado " + ex.Message);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }