public JsonResult GetTableById(double tableID) { IGumruk _iGumruk = new BSGumruk(); int tblID = (int)(tableID / 0.123123); d_b_tables dbTable = _iGumruk.GetTableById(tblID); //string json = JsonConvert.SerializeObject(schemas); TableProperties dt = new Models.TableProperties() { TableName = dbTable.name, SchemaName = dbTable.d_b_schemas.name, ColumnCount = dbTable.d_b_columns.Count, SchemaID = dbTable.d_b_schemasId, }; foreach (var item2 in dbTable.d_b_columns) { foreach (var item3 in item2.d_b_column_lookups) { item3.d_b_Column_to = _iGumruk.GetColumnById(item3.column_to_id); dt.RelatedTables = dt.RelatedTables + " " + item3.d_b_Column_to.d_b_tables.d_b_schemas.name + "." + item3.d_b_Column_to.d_b_tables.name + "." + item3.d_b_Column_to.name; } } return(Json(dt, JsonRequestBehavior.AllowGet)); }
public JsonResult GetColumnById(int columnID) { IGumruk _iGumruk = new BSGumruk(); d_b_columns dbColumns = _iGumruk.GetColumnById(columnID); //string json = JsonConvert.SerializeObject(schemas); DataColumnForJson dt = new Models.DataColumnForJson() { Name = dbColumns.name, DataType = dbColumns.d_b_column_types.name, isNull = dbColumns.isnull == true ? "Evet" : "Hayır", Length = dbColumns.length.ToString(), Precision = dbColumns.precision.ToString(), Scale = dbColumns.scale.ToString(), Unique = dbColumns.isunique == true ? "Evet" : "Hayır", schemaID = dbColumns.d_b_tables.d_b_schemasId, }; return(Json(dt, JsonRequestBehavior.AllowGet)); }