コード例 #1
0
ファイル: DataBases.cs プロジェクト: itcodium/reader
    public void TableSelectData(string schema, string table, string alias, string filter)
    {
        CatalogBus        catalog = new CatalogBus();
        DataTable         dt;
        DataTableToString d;
        string            strTable = "{}";
        int result  = 0;
        var message = "";

        try
        {
            d        = new DataTableToString();
            dt       = catalog.TableSelectData(schema, table, alias, filter).Tables[0];
            strTable = d.ConvertDataTableToString(dt);
        }
        catch (Exception ex)
        {
            result  = -1;
            message = ex.Message;
        }

        string resEstado = "{\"result\":\"" + result.ToString() + "\", \"message\":\"" + message + "\"}";

        Context.Response.ContentType = "application/json;charset=utf-8";
        Context.Response.Write(Context.Request["callback"] + "( [ " + resEstado + ",{\"schema\":\"" + schema + "\", \"table\":\"" + table + "\"} ,{\"datos\": " + strTable + "}])");
    }
コード例 #2
0
ファイル: DataBases.cs プロジェクト: itcodium/reader
    public void TableNavigate(string schema, string table)
    {
        CatalogBus catalog = new CatalogBus();
        DataSet    dsNav   = catalog.TableNavigate(schema, table);
        DataTable  dt      = dsNav.Tables[0];
        DataTable  dtType  = dsNav.Tables[1];


        DataTableToString d        = new DataTableToString();
        string            strTable = d.ConvertDataTableToString(dt);

        Context.Response.ContentType = "application/json;charset=utf-8";
        Context.Response.Write(Context.Request["callback"] + "( [{\"schema\":\"" + schema + "\", \"table\":\"" + table + "\", \"type\":\"" + dtType.Rows[0]["type"].ToString() + "\", \"pk\":\"" + dtType.Rows[0]["pk"].ToString() + "\" } ,{\"datos\": " + strTable + "}])");
    }
コード例 #3
0
ファイル: NewsReader.cs プロジェクト: itcodium/reader
    public void NewsGetToExport(int cantidad)
    {
        NewsBus   news = new NewsBus();
        DataTable dt;
        string    strTable = "";

        try
        {
            dt = news.NewsGetToExport(cantidad).Tables[0];
            DataTableToString d = new DataTableToString();
            strTable = d.ConvertDataTableToString(dt);
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        Context.Response.ContentType = "application/json;charset=utf-8";
        Context.Response.Write(Context.Request["callback"] + strTable);
    }
コード例 #4
0
ファイル: NewsPaper.cs プロジェクト: itcodium/reader
    public void NewsPaperGetAll()
    {
        NewsPaperBus newspaper = new NewsPaperBus();
        DataTable    dt;
        string       strTable = "";

        try
        {
            dt = newspaper.NewsPaperGetAll().Tables[0];
            DataTableToString d = new DataTableToString();
            strTable = d.ConvertDataTableToString(dt);
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }

        Context.Response.ContentType = "application/json;charset=utf-8";
        Context.Response.Write(Context.Request["callback"] + "(" + strTable + ")");
    }
コード例 #5
0
ファイル: DataBases.cs プロジェクト: itcodium/reader
    public void TableGetAll(string schema)
    {
        CatalogBus catalog = new CatalogBus();
        DataTable  dt;
        var        strTable = "";

        try
        {
            dt = catalog.TablesGetAll(schema).Tables[0];
            DataTableToString d = new DataTableToString();
            strTable = d.ConvertDataTableToString(dt);
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }

        Context.Response.ContentType = "application/json;charset=utf-8";
        Context.Response.Write(Context.Request["callback"] + "(" + strTable + ")");
    }
コード例 #6
0
ファイル: NewsPaper.cs プロジェクト: itcodium/reader
    public void NewsGetByNewsPaper(int IdNewsPaper)
    {
        NewsPaperBus newspaper = new NewsPaperBus();
        DataTable    dt;
        string       strTable     = "";
        string       strNewsPaper = "";

        try
        {
            DataRow dr = newspaper.NewsPaperGetById(IdNewsPaper);
            strNewsPaper = dr["Nombre"].ToString();
            dt           = newspaper.NewsGetByNewsPaper(IdNewsPaper).Tables[0];
            DataTableToString d = new DataTableToString();
            strTable = d.ConvertDataTableToString(dt);
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }

        Context.Response.ContentType = "application/json;charset=utf-8";
        //  Context.Response.Write(Context.Request["callback"] + "(" + strTable + ")");
        Context.Response.Write(Context.Request["callback"] + "( [{\"NewsPaper\":\"" + strNewsPaper + "\"} ,{\"data\": " + strTable + "}])");
    }