using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization.Json;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Common;
using DevExpress.Utils.Text.Internal;
using DevExpress.Web.ASPxTabControl;
using Framework;
using NPOI.SS.Formula.Functions;
using WebApp.Common;
using Contract.Domain;
using System.Collections;
using Match = System.Text.RegularExpressions.Match;
using System.Runtime.Serialization;

namespace HraWeb
{
[DataContract(Namespace = "Contract.Domain")]
public class UserTabColumn
{
[DataMember]
public virtual string ColumnName { get; set; }
[DataMember]
public virtual string DataType { get; set; }

[DataMember]
public virtual string Comments { get; set; }
}
public partial class BasInstDefaultValueConfigManage : EntityDetail<BasInstDefaultValue>
{

//初始页面控件
protected override void InitPage(string id)
{

// BindEntityDrop(txt_TableName_, "all_tables",false);
base.InitPage(id);
}
protected void BindEntityDrop()
{

//txt_InstrumentTypeId_.DataTextField = "InstrumentTypeName";
//txt_InstrumentTypeId_.DataValueField = "Id";
//txt_InstrumentTypeId_.DataSource =
// Holworth.Utility.Utility.ListToT<BasInstrumentType>(Dao.FindList(new QueryInfo("BasInstrumentType")))
// .ToList();
//txt_InstrumentTypeId_.DataBind();

}

protected override BasInstDefaultValue LoadData(string id)
{
var obj = base.LoadData(id);
return obj;
}

protected override void Page_Load(object sender, EventArgs e)
{

if (Request["_method"] == "Table2Drop")
{
string tableName = Request["entityType"] ?? "";
if (!string.IsNullOrEmpty(tableName))
Table2Drop(tableName);
}
else if (Request["_method"] == "getTable")
{
GetTable();

}
else if (Request["_method"] == "getModel")
{
getModel();
}

// base.svc = Psvc;
base.Page_Load(sender, e);
}

public void getModel()
{
string tname = Request["_tname"] ?? "";
if (!string.IsNullOrEmpty(tname))
{
QueryInfo info=new QueryInfo("BasInstDefaultValue");
}
}

public void GetTable()
{
string tname = Request["tname"];
QueryInfo colTypeInfo = new QueryInfo();
colTypeInfo.CustomSQL = string.Format(@"select a.column_name column_name,a.DATA_TYPE DATA_TYPE,b.comments comments from User_Tab_Columns a inner join user_col_comments b on a.table_name=b.table_name
and lower(a.column_name) not in(
'sequence',
'is_deleted',
'py',
'create_uid',
'create_uname',
'create_oid',
'create_pid',
'create_date',
'last_mod_uid',
'last_mod_uname',
'last_mod_oid',
'last_mod_pid',
'last_mod_datetime')
and a.column_name=b.column_name where a.TABLE_NAME=upper(trim('{0}'))", tname.ToUpper());
List<UserTabColumn> columnDic = Dao.ExcuteDataSet(colTypeInfo).Tables[0].ToList<UserTabColumn>();
var s = Newtonsoft.Json.JsonConvert.SerializeObject(columnDic);
HttpContext.Current.Response.Write(s);
HttpContext.Current.Response.End();

}

public void Table2Drop(string tableName)
{
QueryInfo tabInfo = new QueryInfo();
tabInfo.CustomSQL = @"select a.TABLE_NAME TABLE_NAME,b.COMMENTS COMMENTS
from user_tables a,user_tab_comments b
WHERE a.TABLE_NAME=b.TABLE_NAME
";
//
var keyword = Request["keyword"] ?? string.Empty;
if (!string.IsNullOrEmpty(keyword))
{

tabInfo.CustomSQL += string.Format(" and b.{0} like '%{1}%'", "COMMENTS", keyword);

}
//tabInfo.PageSize = int.Parse(HttpContext.Current.Request["rows"]);
//int pageIndex = int.Parse(HttpContext.Current.Request["page"]);
//tabInfo.StartRecord = (pageIndex - 1) * tabInfo.PageSize;
//tabInfo.TotalCount = 1;
//
DataTable dt = Dao.ExcuteDataSet(tabInfo).Tables[0];
var s = Newtonsoft.Json.JsonConvert.SerializeObject(dt);
HttpContext.Current.Response.Write(s);
HttpContext.Current.Response.End();

}

protected Hashtable SetInfo()
{
Hashtable aa = new Hashtable();
aa.Clear();
foreach (string key in Request.Params.Keys)
{
if (regEx.IsMatch(key))
{
Match m = regEx.Match(key);
string g = m.Groups["TAG"].Value;
if (string.IsNullOrEmpty(Request.Params[key]))
{
continue;
}
if (string.IsNullOrEmpty(g))
{
if (!aa.Contains(m.Groups["PROP"].Value))
{
aa.Add(m.Groups["PROP"].Value, Request.Params[key]);
}
}
else
{
if (!aa.Contains(m.Groups["PROP"].Value + "_" + g))
{
aa.Add(m.Groups["PROP"].Value + "_" + g, Request.Params[key]);
}

}
}
}
return aa;
}
private static string regexCtlValObj = @"\w{3,5}?_(?<PROP>\w*)_(?<TAG>(\w\d{1,2})*)$";
public static System.Text.RegularExpressions.Regex regEx = new Regex(regexCtlValObj, RegexOptions.IgnoreCase);

private Contract.IService.IRskValuationModelConfigService psvc;
/// <summary>
/// 初始化
/// </summary>
Contract.IService.IRskValuationModelConfigService Psvc
{
get
{
if (psvc == null)
{
psvc = ctx.GetObject("RskValuationModelConfigService") as Contract.IService.IRskValuationModelConfigService;
}
return psvc;

}
}

}
}

oracle获取表和列的备注的更多相关文章

  1. Oracle 获取表的主键、外键以及唯一约束条件

    Oracle 获取表的主键.外键以及唯一约束条件 Select a.Owner 主键拥有者, a.table_name 主键表, b.Column_Name 主键列, b.Constraint_Nam ...

  2. MySql 、Oracle 获取表结构和字段信息

    1.MySql获取表结构信息 SELECT TABLE_NAME, TABLE_COMMENT FROM information_schema.`TABLES` WHERE TABLE_SCHEMA ...

  3. Oracle 获取表结构信息

    通过Oracle中的user_tab_cols, user_col_comments, user_constraints, user_cons_columns表联合查询. user_tab_cols用 ...

  4. ORACLE获取表信息方法

    获取表: select table_name from user_tables; //当前用户的表 select table_name from all_tables; //所有用户的表 select ...

  5. Oracle 获取表注释和列注释

    全部表 select table_name from user_tables; //当前用户拥有的表 select table_name from all_tables; //所有用户的表 selec ...

  6. SqlServer和Oracle判断表和列是否存在

    SqlServer .判断表Users是否存在 if object_id(N'Users',N'U') is not null print '存在' else print '不存在' .判断表User ...

  7. Oracle判断表、列、主键是否存在的方法

    在编写程序时,数据库结构会经常变化,所以经常需要编写一些数据库脚本,编写完成后需发往现场执行,如果已经存在或者重复执行,有些脚本会报错,所以需要判断其是否存在,现在我就把经常用到的一些判断方法和大家分 ...

  8. oracle给表及列添加注释

    给表添加注释 comment on   table    MW_SYS.MWT_OM_OBJ1 is '业务类型的对象实例.'; 给表中的列添加注释 comment on column MW_SYS. ...

  9. MYSQL 获取表的列信息

    SELECT COLUMN_NAME as '列名' ,DATA_TYPE as '字段类型' ,COLUMN_TYPE as '长度加类型' FROM information_schema.`COL ...

随机推荐

  1. sapconnector.dll download

    Sapnoc30Demo_Yan.rar Sap30Server.rar SAPNCO_Sample_Code.zip sapcon3.0_X64.rar DbEntry.Net.4.1.Setup. ...

  2. Python学习笔记之selenium 定制启动 chrome 的选项

    在自动化中,默认情况下我们打开的就是一个普通的纯净的chrome浏览器,而我们平时在使用浏览器时,经常就添加一些插件,扩展,代理之类的应用.所以使用 selenium 时,我们可能需要对 chrome ...

  3. [转载]amba_device使用分析

    什么是AMBA? ---AMBA是一个片内总线规范. ARM官网的介绍:http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0 ...

  4. 数据分析与处理之二(Leveldb 实现原理)

    郑重声明:本篇博客是自己学习 Leveldb 实现原理时参考了郎格科技系列博客整理的,原文地址:http://www.samecity.com/blog/Index.asp?SortID=12,只是为 ...

  5. 1088 Rational Arithmetic

    题意: 给出两个分式(a1/b1 a2/b2),分子.分母的范围为int型,且确保分母不为0.计算两个分数的加减乘除,结果化为最简的形式,即"k a/b",其中若除数为0的话,输出 ...

  6. PL/SQL 训练12--动态sql和绑定变量

    --什么是动态SQL?动态PL/SQL--动态SQL是指在运行时刻才构建执行的SQL语句--动态PL/SQL是指整个PL/SQL代码块都是动态构建,然后再编译执行 --动态SQL来可以用来干什么? - ...

  7. 在液晶屏里显示浮点数的方法 (sprintf 的妙用)

    思路:使用 sprintf 函数将浮点型数据转为指定格式的字符串 #include <stdio.h> #include<string.h> int main() { unsi ...

  8. keil:C语言里面调用汇编程序

    C语言直观,汇编效率高,C里面嵌入汇编是很好的选择. 路径大概如图: mian.c是我的C语言程序,Func.s是汇编程序. 主要是Init_1这个函数的实现在汇编文件里面,使用汇编实现的. 首先在C ...

  9. leetcode375

    public class Solution { public int GetMoneyAmount(int n) { , n + ]; , n); } int DP(int[,] t, int s, ...

  10. 异常:java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path '/app/userInfoMaint/getProvince.do'

    调试代码时出现异常:java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path '/app/user ...