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 + "}])"); }
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 + "}])"); }
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); }
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 + ")"); }
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 + ")"); }
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 + "}])"); }