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. 洛谷P1979 华容道

    神の契约 题目大意:自己看去... 题解:做了一下午...本蒟蒻立志要写全网最详细的题解.╭(╯^╰)╮ begin.... 暴力70分.可以让空格子到处乱走,只要某个状态的指定格子到目标格子,那么此 ...

  2. 设置ubantu的软件源地址

    查看所用的源 $ sudo vim /etc/apt/sources.list 由于安装的Ubuntu Server 16.04.1 LTS是英文版的,软件源就默认都是 us.archive.ubun ...

  3. dxjk中 支付宝二维码支付 git 存疑

    线上的vendor/latrell/alipay 文件拉取不了至本地,失去了git监控 要想本地使用 1.注释掉config/app.php 'providers' 下的Latrell模块 2.下载线 ...

  4. ADO+MFC数据库编程常用语句

    设在OnInitDialog()函数中,已经完成了初始化COM,创建ADO连接等操作,即 // 初始化COM,创建ADO连接等操作 if (!AfxOleInit()) { AfxMessageBox ...

  5. MongoDB-WriteConcern

    WriteConcern safe=false 非安全模式 很快

  6. shell编程中用户输入处理(shell 04)

    shell编程中用户输入处理1.命令行参数2.脚本运行时获取输入 命令行参数 通过空格来进行分割的位置参数 :$+position $0,$1,$2 ....$0 :程序名$1,$2,$3 ... $ ...

  7. Java-Runoob:Java 开发环境配置

    ylbtech-Java-Runoob:Java 开发环境配置 1.返回顶部 1. Java 开发环境配置 在本章节中我们将为大家介绍如何搭建Java开发环境. Windows 上安装开发环境 Lin ...

  8. keepalived 预防脑裂检测脚本

    1 检查vip [root@mysql2 keepalived]# cat /etc/keepalived/check_brain_keepalived.sh #!/bin/bash # 检查脑裂的脚 ...

  9. Linux Restricted Shell Bypass

    Author: @n4ckhcker & @h4d3sw0rm Introduction Hello, so first of all let’s explain what is a rest ...

  10. activemq安装运行及其在springboot中的queue和topic使用

    安装activemq 运行 springboot使用 依赖 配置 Producer Consumer ComsumerTopic 使用 安装activemq http://activemq.apach ...